[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Sun Jun 13 13:02:10 MDT 2010


The branch, master has been updated
       via  2edd652... s4-waf: Fix installation of .so links for libraries that are not bundled but have a mangled name.
       via  d319c83... librpc: Install the right headers.
       via  08c9725... Support system talloc/tevent headers.
       via  14f1ce7... libgpo: Use system libraries if possible.
       via  c3550c9... librpc: Fix netlogon.h file to install - not the torture one but the one generated by pidl.
       via  f52a0d3... param/share: Use static prototypes.
       via  09fb7fc... Do not use headermap.txt for the header installation
      from  4b6ce8e... s4:fix allocated control OIDs for "password_hash" LDB module

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


- Log -----------------------------------------------------------------
commit 2edd6527294617384b55b151950a21cf08fb79d1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jun 13 20:52:47 2010 +0200

    s4-waf: Fix installation of .so links for libraries that are not bundled but have a mangled name.

commit d319c83f1f117d3b7ab69ec7b0df7eec80721912
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jun 13 19:55:53 2010 +0200

    librpc: Install the right headers.

commit 08c972504a437ccec97dcb51e92fa99ab49ffa11
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jun 13 19:39:20 2010 +0200

    Support system talloc/tevent headers.

commit 14f1ce72ed878e22fb6a016be9dc36bb920c0145
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jun 13 19:35:48 2010 +0200

    libgpo: Use system libraries if possible.

commit c3550c9c28d11442b17f53dc6be0489aee9827dd
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jun 13 19:21:17 2010 +0200

    librpc: Fix netlogon.h file to install - not the torture one but the one
    generated by pidl.

commit f52a0d31f08aff9eb8e8890730ec76dfdee7016a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jun 13 19:21:02 2010 +0200

    param/share: Use static prototypes.

commit 09fb7fcd5f63e180007958de82e59359cc8cfd5e
Author: Thomas Nagy <tnagy2pow10 at gmail.com>
Date:   Mon May 24 02:26:36 2010 +0200

    Do not use headermap.txt for the header installation
    
    Try to find the headers by searching on the filesystem. Warn when
    a public header replacement cannot be found (talloc.h, ...).
    
    Signed-off-by: Jelmer Vernooij <jelmer at samba.org>

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

Summary of changes:
 buildtools/wafsamba/samba_install.py |    2 +-
 buildtools/wafsamba/wafsamba.py      |  102 +++++++++++++++++++++++-----------
 lib/util/tevent_ntstatus.h           |    2 +-
 libgpo/gpo_fetch.c                   |    2 +-
 libgpo/gpo_util.c                    |    2 +-
 source4/lib/ldb/include/ldb.h        |    4 +-
 source4/librpc/wscript_build         |    4 +-
 source4/param/share.h                |   16 +++++-
 source4/param/wscript_build          |    1 -
 9 files changed, 92 insertions(+), 43 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
index 4e968bf..4172209 100644
--- a/buildtools/wafsamba/samba_install.py
+++ b/buildtools/wafsamba/samba_install.py
@@ -97,7 +97,7 @@ def install_library(self):
         install_name = 'lib%s.so.%s' % (self.target, self.vnum)
         install_link = 'lib%s.so.%s' % (self.target, vnum_base)
         inst_name    = 'lib%s.so' % t.target
-        if self.target == self.name:
+        if not self.is_bundled:
             # only generate the dev link for non-bundled libs
             dev_link     = 'lib%s.so' % self.target
     else:
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 13f3f8c..4b0580d 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -201,7 +201,8 @@ def SAMBA_LIBRARY(bld, libname, source,
         samba_realname  = realname,
         samba_install   = install,
         abi_file        = abi_file,
-        abi_match       = abi_match
+        abi_match       = abi_match,
+        is_bundled      = is_bundled
         )
 
     if realname and not link_name:
@@ -635,23 +636,60 @@ Build.BuildContext.INSTALL_DIRS = INSTALL_DIRS
 
 re_header = re.compile('#include[ \t]*"([^"]+)"', re.I | re.M)
 class header_task(Task.Task):
+    """
+    The public headers (the one installed on the system) have both
+    different paths and contents, so the rename is not enough.
+
+    Intermediate .inst.h files are created because path manipulation
+    may be slow. The substitution is thus performed only once.
+    """
+
     name = 'header'
     color = 'PINK'
     vars = ['INCLUDEDIR', 'HEADER_DEPS']
+
     def run(self):
         txt = self.inputs[0].read(self.env)
 
+        # hard-coded string, but only present in samba4 (I promise, you won't feel a thing)
         txt = txt.replace('#if _SAMBA_BUILD_ == 4', '#if 1\n')
 
-        themap = self.generator.bld.subst_table
+        # use a regexp to substitute the #include lines in the files
+        map = self.generator.bld.hnodemap
+        dirnodes = self.generator.bld.hnodedirs
         def repl(m):
             if m.group(1):
                 s = m.group(1)
-                return "#include <%s>" % themap.get(s, s)
+
+                # pokemon headers: gotta catch'em all!
+                fin = s
+                if s.startswith('bin/default'):
+                    node = self.generator.bld.srcnode.find_resource(s.replace('bin/default/', ''))
+                    if not node:
+                        Logs.warn('could not find the public header for %r' % s)
+                    elif node.id in map:
+                        fin = map[node.id]
+                    else:
+                        Logs.warn('could not find the public header replacement for build header %r' % s)
+                else:
+                    # this part is more difficult since the path may be relative to anything
+                    for dirnode in dirnodes:
+                        node = dirnode.find_resource(s)
+                        if node:
+                             if node.id in map:
+                                 fin = map[node.id]
+                                 break
+                             else:
+                                 Logs.warn('could not find the public header replacement for source header %r %r' % (s, node))
+                    else:
+                        Logs.warn('-> could not find the public header for %r' % s)
+
+                return "#include <%s>" % fin
             return ''
 
         txt = re_header.sub(repl, txt)
 
+        # and write the output file
         f = None
         try:
             f = open(self.outputs[0].abspath(self.env), 'w')
@@ -660,42 +698,30 @@ class header_task(Task.Task):
             if f:
                 f.close()
 
-def init_subst(bld):
+ at TaskGen.feature('pubh')
+def make_public_headers(self):
     """
-    initialize the header substitution table
-    for now use the file headermap.txt but in the future we will compute the paths properly
+    collect the public headers to process and to install, then
+    create the substitutions (name and contents)
     """
 
-    if getattr(bld, 'subst_table', None):
-        return bld.subst_table_h
-
-    node = bld.srcnode.find_resource("source4/headermap.txt")
-    if not node:
-        bld.subst_table = {}
-        bld.subst_table_h = 0
-        return {}
-    lines = node.read(None)
-
-    lines = [x.strip().split(': ') for x in lines.split('\n') if x.rfind(': ') > -1]
-    bld.subst_table = dict(lines)
-
-    # pidl file replacement (all of this is temporary, one step at a time)
-    keyz = list(bld.subst_table.keys())
-    for k in keyz:
-        bld.subst_table['bin/default/' + k] = bld.subst_table[k]
-
-    tp = tuple(bld.subst_table.keys())
-    bld.subst_table_h = hash(tp)
-    return bld.subst_table_h
-
- at TaskGen.feature('pubh')
-def make_public_headers(self):
     if not self.bld.is_install:
         # install time only (lazy)
         return
 
-    self.env['HEADER_DEPS'] = init_subst(self.bld)
-    # adds a dependency and trigger a rebuild if the dict changes
+    # keep two variables
+    #    hnodedirs: list of folders for searching the headers
+    #    hnodemap: node ids and replacement string (node objects are unique)
+    try:
+        self.bld.hnodedirs.append(self.path)
+    except AttributeError:
+        self.bld.hnodemap = {}
+        self.bld.hnodedirs = [self.bld.srcnode, self.path]
+
+        for k in 'source4 source4/include lib/talloc lib/tevent/ source4/lib/ldb/include/'.split():
+            node = self.bld.srcnode.find_dir(k)
+            if node:
+                self.bld.hnodedirs.append(node)
 
     header_path = getattr(self, 'header_path', None) or ''
 
@@ -725,6 +751,7 @@ def make_public_headers(self):
             dest = s[1]
 
         inn = self.path.find_resource(name)
+
         if not inn:
             raise ValueError("could not find the public header %r in %r" % (name, self.path))
         out = inn.change_ext('.inst.h')
@@ -737,9 +764,18 @@ def make_public_headers(self):
             inst_path = inst_path + '/'
         inst_path = inst_path + dest
 
-        #print("going to install the headers", inst_path, out)
         self.bld.install_as('${INCLUDEDIR}/%s' % inst_path, out, self.env)
 
+        self.bld.hnodemap[inn.id] = inst_path
+
+    # create a hash (not md5) to make sure the headers are re-created if something changes
+    val = 0
+    lst = list(self.bld.hnodemap.keys())
+    lst.sort()
+    for k in lst:
+        val = hash((val, k, self.bld.hnodemap[k]))
+    self.bld.env.HEADER_DEPS = val
+
 def PUBLIC_HEADERS(bld, public_headers, header_path=None):
     '''install some headers
 
diff --git a/lib/util/tevent_ntstatus.h b/lib/util/tevent_ntstatus.h
index 4cf593a..c10aa36 100644
--- a/lib/util/tevent_ntstatus.h
+++ b/lib/util/tevent_ntstatus.h
@@ -23,7 +23,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include "../libcli/util/ntstatus.h"
-#include "../tevent/tevent.h"
+#include <tevent.h>
 
 bool tevent_req_nterror(struct tevent_req *req, NTSTATUS status);
 bool tevent_req_is_nterror(struct tevent_req *req, NTSTATUS *pstatus);
diff --git a/libgpo/gpo_fetch.c b/libgpo/gpo_fetch.c
index 2a7cb9d..ad6c2a8 100644
--- a/libgpo/gpo_fetch.c
+++ b/libgpo/gpo_fetch.c
@@ -25,7 +25,7 @@
 #if _SAMBA_BUILD_ == 4
 #include "param/param.h"
 #include "libcli/resolve/resolve.h"
-#include "../lib/tevent/tevent.h"
+#include <tevent.h>
 #include "libcli/libcli.h"
 #include "libcli/raw/libcliraw.h"
 #include "libcli/libcli_proto.h"
diff --git a/libgpo/gpo_util.c b/libgpo/gpo_util.c
index 0afed55..195f61c 100644
--- a/libgpo/gpo_util.c
+++ b/libgpo/gpo_util.c
@@ -24,7 +24,7 @@
 #if _SAMBA_BUILD_ == 4
 #include "system/filesys.h"
 #include "auth/auth.h"
-#include "../lib/talloc/talloc.h"
+#include <talloc.h>
 #include "source4/libgpo/ads_convenience.h"
 #endif
 #undef strdup
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index b644b99..2eb395c 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -47,8 +47,8 @@
 /*! \endcond */
 
 #include <stdbool.h>
-#include "talloc.h"
-#include "tevent.h"
+#include <talloc.h>
+#include <tevent.h>
 #include "ldb_errors.h"
 
 /*
diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build
index 5e5c5f5..6de3064 100644
--- a/source4/librpc/wscript_build
+++ b/source4/librpc/wscript_build
@@ -31,7 +31,7 @@ bld.SAMBA_SUBSYSTEM('NDR_COMPRESSION',
 bld.SAMBA_SUBSYSTEM('NDR_SECURITY',
 	source='../../librpc/gen_ndr/ndr_security.c ../../librpc/ndr/ndr_sec_helper.c gen_ndr/ndr_server_id.c',
 	public_deps='LIBNDR LIBSECURITY',
-	public_headers='../libcli/security/security.h gen_ndr/server_id.h',
+	public_headers='../../librpc/gen_ndr/security.h gen_ndr/server_id.h',
         header_path='gen_ndr'
 	)
 
@@ -342,7 +342,7 @@ bld.SAMBA_LIBRARY('NDR_STANDARD',
 	pc_files='../../librpc/ndr_standard.pc',
 	deps='NDR_SECURITY',
 	public_deps='LIBNDR',
-	public_headers='../../librpc/gen_ndr/samr.h ../../librpc/gen_ndr/ndr_samr.h ../rpc_server/lsa/lsa.h ../torture/rpc/netlogon.h ../../librpc/gen_ndr/atsvc.h ../../librpc/gen_ndr/ndr_atsvc.h ../../librpc/gen_ndr/ndr_svcctl.h ../../librpc/gen_ndr/svcctl.h',
+	public_headers='../../librpc/gen_ndr/samr.h ../../librpc/gen_ndr/ndr_samr.h ../../librpc/gen_ndr/lsa.h ../../librpc/gen_ndr/netlogon.h ../../librpc/gen_ndr/atsvc.h ../../librpc/gen_ndr/ndr_atsvc.h ../../librpc/gen_ndr/ndr_svcctl.h ../../librpc/gen_ndr/svcctl.h',
         header_path='gen_ndr'
 	)
 
diff --git a/source4/param/share.h b/source4/param/share.h
index 755d19e..ab20c8a 100644
--- a/source4/param/share.h
+++ b/source4/param/share.h
@@ -67,7 +67,21 @@ struct share_ops {
 
 struct loadparm_context;
 
-#include "param/share_proto.h"
+const char *share_string_option(struct share_config *scfg, const char *opt_name, const char *defval);
+int share_int_option(struct share_config *scfg, const char *opt_name, int defval);
+bool share_bool_option(struct share_config *scfg, const char *opt_name, bool defval);
+const char **share_string_list_option(TALLOC_CTX *mem_ctx, struct share_config *scfg, const char *opt_name);
+NTSTATUS share_list_all(TALLOC_CTX *mem_ctx, struct share_context *sctx, int *count, const char ***names);
+NTSTATUS share_get_config(TALLOC_CTX *mem_ctx, struct share_context *sctx, const char *name, struct share_config **scfg);
+NTSTATUS share_create(struct share_context *sctx, const char *name, struct share_info *info, int count);
+NTSTATUS share_set(struct share_context *sctx, const char *name, struct share_info *info, int count);
+NTSTATUS share_remove(struct share_context *sctx, const char *name);
+NTSTATUS share_register(const struct share_ops *ops);
+NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name,
+				   struct tevent_context *event_ctx, 
+				   struct loadparm_context *lp_ctx,
+				   struct share_context **ctx);
+NTSTATUS share_init(void);
 
 /* list of shares options */
 
diff --git a/source4/param/wscript_build b/source4/param/wscript_build
index 1308829..f3729d0 100644
--- a/source4/param/wscript_build
+++ b/source4/param/wscript_build
@@ -18,7 +18,6 @@ bld.SAMBA_PYTHON('PROVISION',
 
 bld.SAMBA_SUBSYSTEM('share',
 	source='share.c',
-	autoproto='share_proto.h',
 	public_headers='share.h',
 	deps='LIBSAMBA-UTIL'
 	)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list