[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Tue Nov 2 20:18:01 MDT 2010


The branch, master has been updated
       via  ef1afae waf: more agressively expand subsystem syslib deps
       via  c1cc156 s4-ldb: make ldbtest depend on ldb
       via  f0a472a waf: added reconfigure targets to our libraries
       via  8c44dfc waf: ensure pkgconfig files depend on the prefix
       via  dfa20fc waf: split pkgconfig logic into a separate module
      from  553029b s4-build: use -Wl,--as-needed if supported

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


- Log -----------------------------------------------------------------
commit ef1afae2cec531797750be32907705566aa2d228
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Nov 3 12:23:43 2010 +1100

    waf: more agressively expand subsystem syslib deps
    
    this solves an openchange build problem with an indirect dependency on
    talloc when talloc is a syslib
    
    Autobuild-User: Andrew Tridgell <tridge at samba.org>
    Autobuild-Date: Wed Nov  3 02:17:30 UTC 2010 on sn-devel-104

commit c1cc1568b86660cd890428172616a38abfa695f5
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Nov 3 12:22:21 2010 +1100

    s4-ldb: make ldbtest depend on ldb

commit f0a472a2d678dd0374181f1a6ac0a3d35503636e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Nov 3 12:09:23 2010 +1100

    waf: added reconfigure targets to our libraries
    
    This allows you to do "make reconfigure" to re-run configure only if
    needed

commit 8c44dfc371b3be2eadfb2f12580f33fde5551370
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Nov 3 11:30:23 2010 +1100

    waf: ensure pkgconfig files depend on the prefix

commit dfa20fcd485b4b3a6b2a9d975374419129e647a4
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Nov 3 11:14:40 2010 +1100

    waf: split pkgconfig logic into a separate module

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

Summary of changes:
 buildtools/wafsamba/pkgconfig.py  |   64 +++++++++++++++++++++++++++++++++++++
 buildtools/wafsamba/samba_deps.py |   13 +++++--
 buildtools/wafsamba/wafsamba.py   |   57 +--------------------------------
 lib/talloc/wscript                |    5 +++
 lib/tdb/wscript                   |    5 +++
 lib/tevent/wscript                |    5 +++
 source4/lib/ldb/wscript           |    7 +++-
 7 files changed, 95 insertions(+), 61 deletions(-)
 create mode 100644 buildtools/wafsamba/pkgconfig.py


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/pkgconfig.py b/buildtools/wafsamba/pkgconfig.py
new file mode 100644
index 0000000..1a41c80
--- /dev/null
+++ b/buildtools/wafsamba/pkgconfig.py
@@ -0,0 +1,64 @@
+# handle substitution of variables in pc files
+
+import Build
+from samba_utils import *
+
+def subst_at_vars(task):
+    '''substiture @VAR@ style variables in a file'''
+    src = task.inputs[0].srcpath(task.env)
+    tgt = task.outputs[0].bldpath(task.env)
+
+    f = open(src, 'r')
+    s = f.read()
+    f.close()
+    # split on the vars
+    a = re.split('(@\w+@)', s)
+    out = []
+    done_var = {}
+    back_sub = [ ('PREFIX', '${prefix}'), ('EXEC_PREFIX', '${exec_prefix}')]
+    for v in a:
+        if re.match('@\w+@', v):
+            vname = v[1:-1]
+            if not vname in task.env and vname.upper() in task.env:
+                vname = vname.upper()
+            if not vname in task.env:
+                Logs.error("Unknown substitution %s in %s" % (v, task.name))
+                sys.exit(1)
+            v = SUBST_VARS_RECURSIVE(task.env[vname], task.env)
+            # now we back substitute the allowed pc vars
+            for (b, m) in back_sub:
+                s = task.env[b]
+                if s == v[0:len(s)]:
+                    if not b in done_var:
+                        # we don't want to substitute the first usage
+                        done_var[b] = True
+                    else:
+                        v = m + v[len(s):]
+                    break
+        out.append(v)
+    contents = ''.join(out)
+    f = open(tgt, 'w')
+    s = f.write(contents)
+    f.close()
+    return 0
+
+
+def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
+    '''install some pkg_config pc files'''
+    dest = '${PKGCONFIGDIR}'
+    dest = bld.EXPAND_VARIABLES(dest)
+    for f in TO_LIST(pc_files):
+        base=os.path.basename(f)
+        t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base,
+                                rule=subst_at_vars,
+                                source=f+'.in',
+                                target=f)
+        t.vars = []
+        for v in [ 'PREFIX', 'EXEC_PREFIX' ]:
+            t.vars.append(t.env[v])
+        if vnum:
+            t.env.PACKAGE_VERSION = vnum
+        bld.INSTALL_FILES(dest, f, flat=True, destname=base)
+Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES
+
+
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 13b11ff..60f2fa9 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -90,7 +90,12 @@ def build_dependencies(self):
 
     if self.samba_type in ['SUBSYSTEM']:
         # this is needed for the ccflags of libs that come from pkg_config
-        self.uselib = list(self.direct_syslibs)
+        self.uselib = list(self.final_syslibs)
+        self.uselib.extend(list(self.direct_syslibs))
+        for lib in self.final_libs:
+            t = self.bld.name_to_obj(lib, self.bld.env)
+            self.uselib.extend(list(t.final_syslibs))
+        self.uselib = unique_list(self.uselib)
 
     if getattr(self, 'uselib', None):
         up_list = []
@@ -352,10 +357,10 @@ def show_final_deps(bld, tgt_list):
     targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
 
     for t in tgt_list:
-        if not targets[t.sname] in ['LIBRARY', 'BINARY', 'PYTHON']:
+        if not targets[t.sname] in ['LIBRARY', 'BINARY', 'PYTHON', 'SUBSYSTEM']:
             continue
         debug('deps: final dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
-              t.sname, t.uselib, t.uselib_local, t.add_objects)
+              t.sname, t.uselib, getattr(t, 'uselib_local', []), getattr(t, 'add_objects', []))
 
 
 def add_samba_attributes(bld, tgt_list):
@@ -860,7 +865,7 @@ def calculate_final_deps(bld, tgt_list, loops):
 
     # add in any syslib dependencies
     for t in tgt_list:
-        if not t.samba_type in ['BINARY','PYTHON','LIBRARY']:
+        if not t.samba_type in ['BINARY','PYTHON','LIBRARY','SUBSYSTEM']:
             continue
         syslibs = set()
         for d in t.final_objects:
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 6d09aed..daab00c 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -28,6 +28,7 @@ import samba_dist
 import samba_wildcard
 import stale_files
 import symbols
+import pkgconfig
 
 # some systems have broken threading in python
 if os.environ.get('WAF_NOTHREADS') == '1':
@@ -819,62 +820,6 @@ def PUBLIC_HEADERS(bld, public_headers, header_path=None):
 Build.BuildContext.PUBLIC_HEADERS = PUBLIC_HEADERS
 
 
-def subst_at_vars(task):
-    '''substiture @VAR@ style variables in a file'''
-    src = task.inputs[0].srcpath(task.env)
-    tgt = task.outputs[0].bldpath(task.env)
-
-    f = open(src, 'r')
-    s = f.read()
-    f.close()
-    # split on the vars
-    a = re.split('(@\w+@)', s)
-    out = []
-    done_var = {}
-    back_sub = [ ('PREFIX', '${prefix}'), ('EXEC_PREFIX', '${exec_prefix}')]
-    for v in a:
-        if re.match('@\w+@', v):
-            vname = v[1:-1]
-            if not vname in task.env and vname.upper() in task.env:
-                vname = vname.upper()
-            if not vname in task.env:
-                Logs.error("Unknown substitution %s in %s" % (v, task.name))
-                sys.exit(1)
-            v = SUBST_VARS_RECURSIVE(task.env[vname], task.env)
-            # now we back substitute the allowed pc vars
-            for (b, m) in back_sub:
-                s = task.env[b]
-                if s == v[0:len(s)]:
-                    if not b in done_var:
-                        # we don't want to substitute the first usage
-                        done_var[b] = True
-                    else:
-                        v = m + v[len(s):]
-                    break
-        out.append(v)
-    contents = ''.join(out)
-    f = open(tgt, 'w')
-    s = f.write(contents)
-    f.close()
-    return 0
-
-
-def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
-    '''install some pkg_config pc files'''
-    dest = '${PKGCONFIGDIR}'
-    dest = bld.EXPAND_VARIABLES(dest)
-    for f in TO_LIST(pc_files):
-        base=os.path.basename(f)
-        t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base,
-                                rule=subst_at_vars,
-                                source=f+'.in',
-                                target=f)
-        if vnum:
-            t.env.PACKAGE_VERSION = vnum
-        INSTALL_FILES(bld, dest, f, flat=True, destname=base)
-Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES
-
-
 def MANPAGES(bld, manpages):
     '''build and install manual pages'''
     bld.env.MAN_XSL = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index dd0dc92..a931e1e 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -132,3 +132,8 @@ def test(ctx):
 def dist():
     '''makes a tarball for distribution'''
     samba_dist.dist()
+
+def reconfigure(ctx):
+    '''reconfigure if config scripts have changed'''
+    import samba_utils
+    samba_utils.reconfigure(ctx)
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index fcb15f8..febd76b 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -126,3 +126,8 @@ def test(ctx):
 def dist():
     '''makes a tarball for distribution'''
     samba_dist.dist()
+
+def reconfigure(ctx):
+    '''reconfigure if config scripts have changed'''
+    import samba_utils
+    samba_utils.reconfigure(ctx)
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 590fbfe..8f8820f 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -101,3 +101,8 @@ def test(ctx):
 def dist():
     '''makes a tarball for distribution'''
     samba_dist.dist()
+
+def reconfigure(ctx):
+    '''reconfigure if config scripts have changed'''
+    import samba_utils
+    samba_utils.reconfigure(ctx)
diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript
index 45496c8..28373b5 100644
--- a/source4/lib/ldb/wscript
+++ b/source4/lib/ldb/wscript
@@ -219,7 +219,7 @@ def build(bld):
                          manpages='man/%s.1' % t)
 
     # ldbtest doesn't get installed
-    bld.SAMBA_BINARY('ldbtest', 'tools/ldbtest.c', deps='ldb-cmdline',
+    bld.SAMBA_BINARY('ldbtest', 'tools/ldbtest.c', deps='ldb-cmdline ldb',
                      install=False)
 
 
@@ -234,3 +234,8 @@ def test(ctx):
 def dist():
     '''makes a tarball for distribution'''
     samba_dist.dist()
+
+def reconfigure(ctx):
+    '''reconfigure if config scripts have changed'''
+    import samba_utils
+    samba_utils.reconfigure(ctx)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list