[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Thu Feb 17 22:04:06 MST 2011


The branch, master has been updated
       via  e929223 build: put links for libs in the right directory
       via  40a48f5 s4-util: removed the valgrind_strlen() routine
       via  324270e libutil: make waf rules usable by s3 waf build
       via  13bffa0 waf: improved error message for bad paths in SAMBA_LIBRARY()
       via  1c5108c waf: support building libraries with a directory prefix
       via  8850829 s3-waf: fixed the include paths for samba public libraries
       via  fd00092 charset: allow s3 waf build to use lib/util/charset
       via  ba942c8 waf: added SAMBA3_*() build rules to samba3.py
       via  c745601 waf: give a more sensible error on symlink_bin with missing directory
       via  13f287f lib/util/charset use get_dyn_CODEPAGEDIR(), which is in common
       via  a47120a lib/util/charset split codepoints.c into it's own subsystem
       via  d8d81a7 lib/util/charset use a path to dynconfig.h that works in s3 and s4
       via  0581a5b lib/util/charset add functions isupper_m and islower_m
       via  ed71c1e s4-auth: rename 'auth' subsystem to 'auth4'
       via  35a1163 build: remember the flags used for undefined variable errors
       via  3a5b199 s3build: added NMBDSOCKETDIR to dynconfig
       via  600c726 s4-dsdb: operational module does not need auth any more
       via  b74ac94 s3-includes: force _SAMBA_BUILD_=3 in source3 includes.h
       via  d5d26e3 uid-wrapper: handle uwrap_enabled() as a macro
       via  066a93d build: fixed passing of includes= for modules
       via  1570058 build: added subdir option for module building
       via  8ef9cb0 build: added allow_undefined_symbols options for libraries and modules
       via  b310551 build: make ADD_LDFLAGS() returns the flags that were added
       via  433f68e waf: library_flags() doesn't only operate on conf objects
       via  41b1f97 s3-build: allow waf build of s3 IDL files from any top directory
       via  aec0155 waf: added subdir= option in SAMBA_*() rules
       via  a7ee6e8 waf: use Utils.WafError() instead of sys.exit(1)
      from  7720fac tevent: Fix a comment

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


- Log -----------------------------------------------------------------
commit e92922308b5636d1b23fa44f1f8aa50413d48d77
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Feb 18 10:52:48 2011 +1100

    build: put links for libs in the right directory
    
    when a library is declared as libdir/libname, still put the symlink in
    bin/shared
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User: Andrew Tridgell <tridge at samba.org>
    Autobuild-Date: Fri Feb 18 06:03:57 CET 2011 on sn-devel-104

commit 40a48f5502e216af2e7e6788694ad4e094f59d83
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Feb 18 10:44:46 2011 +1100

    s4-util: removed the valgrind_strlen() routine
    
    this was for a bug in valgrind from 7 years ago.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 324270ee572c86d48ff1ee84cc16924ef18ee2b9
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 17 15:42:10 2011 +1100

    libutil: make waf rules usable by s3 waf build
    
    we need samba-util to be s4 only for now, because of the debug system
    differences
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 13bffa02d8a349b21bace8d96d0ae5af6d75e00b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 17 15:14:57 2011 +1100

    waf: improved error message for bad paths in SAMBA_LIBRARY()
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 1c5108c98b51c7c3edcd94d3a238d0476ece53dd
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 17 14:42:19 2011 +1100

    waf: support building libraries with a directory prefix
    
    SAMBA_LIBRARY('libsmb/smbclient') can now be built, which
    distinguishes it from the binary 'smbclient'
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 88508291fe80829b559f8e6b91a7453e03479111
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 17 14:15:31 2011 +1100

    s3-waf: fixed the include paths for samba public libraries
    
    this fixes the extra global includes for the s3 waf build to be
    conditional on whether talloc, tevent and tdb are system libraries or
    not.
    
    This fixes a problem where in-tree includes could be used with system
    libraries
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit fd000928e3ccbb5a3eb447f4644e290dc5dae016
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 17 14:12:36 2011 +1100

    charset: allow s3 waf build to use lib/util/charset
    
    the only conflict is with 'CHARSET' itself, which now builds
    conditionally on _SAMBA_BUILD_==4
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit ba942c8bfeff87b11af0ffb1e55dc77d4d5c64f0
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 17 14:11:33 2011 +1100

    waf: added SAMBA3_*() build rules to samba3.py
    
    these provide samba build rule wrappers for Samba3 specific subsystems
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit c7456013b970cf07a517c006d7f38713631d838d
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 17 14:03:13 2011 +1100

    waf: give a more sensible error on symlink_bin with missing directory
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 13f287fbc2ce4d92c9c2da328250bb38e9266ad7
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Feb 16 16:44:41 2011 +1100

    lib/util/charset use get_dyn_CODEPAGEDIR(), which is in common
    
    This is provided by the s3 and s4 dynconfig implementations.
    
    Andrew Bartlett

commit a47120ae93b3a8f99edf9453b596fb4bb7bb30b4
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Feb 16 16:26:05 2011 +1100

    lib/util/charset split codepoints.c into it's own subsystem

commit d8d81a778649881972a9afa671e46e4741f8818c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Feb 16 16:25:39 2011 +1100

    lib/util/charset use a path to dynconfig.h that works in s3 and s4

commit 0581a5bb3cae6b00b2b78b57b86c3ac350759114
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Feb 16 16:24:12 2011 +1100

    lib/util/charset add functions isupper_m and islower_m

commit ed71c1ef1fbeb5d2ba3aa98954b6a1e018515f46
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:30:35 2011 +1100

    s4-auth: rename 'auth' subsystem to 'auth4'
    
    this prevents conflicts with the s3 auth modules. The auth modules in
    samba3 may appear in production smb.conf files, so it is preferable to
    rename the s4 modules for minimal disruption.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 35a11630c1727677df24cdaa42526e89f7614172
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:29:13 2011 +1100

    build: remember the flags used for undefined variable errors
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 3a5b199752a925e52a207ab0547a2a77c31ab097
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:28:05 2011 +1100

    s3build: added NMBDSOCKETDIR to dynconfig
    
    this is needed for the s3 top level build
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 600c726f51099e607b06a257dc04af95ac06b2c2
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:27:26 2011 +1100

    s4-dsdb: operational module does not need auth any more
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit b74ac941f9b72931963b6a629553d2fc2bb1e4ff
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:19:46 2011 +1100

    s3-includes: force _SAMBA_BUILD_=3 in source3 includes.h
    
    this allows a common set of cflags for a top level combined build
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit d5d26e3269cea38f1cdcd060560ad5d1e3e23589
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:18:58 2011 +1100

    uid-wrapper: handle uwrap_enabled() as a macro
    
    some s3 code defines uwrap_enabled() as a macro. Detect this, and
    don't redeclare the functions
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 066a93d41cbb2ecbbcc63646c11a28d7ca291c76
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:17:30 2011 +1100

    build: fixed passing of includes= for modules
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 1570058b0d8754e8cc3f4e949eb2365df3becffd
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:16:54 2011 +1100

    build: added subdir option for module building
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 8ef9cb0bedd88177c7880f7441df77a989b7b046
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:15:15 2011 +1100

    build: added allow_undefined_symbols options for libraries and modules
    
    the s4 build uses linker flags to disallow undefined symbols in
    libraries. To accomodate s3 libraries in the top level build we need
    to be able to disable this on a per-library basis.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit b31055189ad953e2055d99caff3f8490613b96b4
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:13:51 2011 +1100

    build: make ADD_LDFLAGS() returns the flags that were added
    
    this will be used by the s3 top level build to work out how to undo
    the effects of -Wl,-no-undefined
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 433f68efaab8418f44cde29c6c857680719dda79
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Feb 15 16:13:05 2011 +1100

    waf: library_flags() doesn't only operate on conf objects
    
    use a better name for the first argument
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 41b1f9794335ed2308d366a323bc44d1d7b23329
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Feb 9 17:06:40 2011 +1100

    s3-build: allow waf build of s3 IDL files from any top directory
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit aec015525b09fce9ce7be274d1a4591f81fac0ef
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Feb 9 15:55:18 2011 +1100

    waf: added subdir= option in SAMBA_*() rules
    
    this allows you to prepend a subdirectory to the source rules, after
    variable substitution. This is useful for the s3 waf build when it is
    in s3build/

commit a7ee6e81fffc92d85dca26ae236e339e7d7eb83e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Feb 9 15:54:07 2011 +1100

    waf: use Utils.WafError() instead of sys.exit(1)
    
    better to raise an expection than just exiting

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

Summary of changes:
 buildtools/wafsamba/samba3.py                |   74 ++++++++++++++++++++++++-
 buildtools/wafsamba/samba_abi.py             |    2 +
 buildtools/wafsamba/samba_autoconf.py        |   19 ++++---
 buildtools/wafsamba/samba_deps.py            |    9 ++-
 buildtools/wafsamba/samba_install.py         |    4 +-
 buildtools/wafsamba/samba_utils.py           |   11 +++-
 buildtools/wafsamba/wafsamba.py              |   31 +++++++++-
 lib/uid_wrapper/uid_wrapper.h                |    2 +
 lib/util/charset/charset.h                   |    3 +
 lib/util/charset/codepoints.c                |   22 ++++++-
 lib/util/charset/wscript_build               |   14 +++--
 lib/util/util.h                              |    7 --
 lib/util/util_str.c                          |   11 ----
 lib/util/wscript_build                       |   77 +++++++++++++-------------
 source3/include/includes.h                   |    5 ++
 source3/librpc/idl/wscript_build             |    9 ++-
 source3/wscript                              |   12 +++-
 source4/auth/auth.h                          |    2 +-
 source4/auth/ntlm/auth.c                     |    8 +-
 source4/auth/ntlm/auth_server_service.c      |    2 +-
 source4/auth/ntlm/wscript_build              |   30 +++++-----
 source4/auth/wscript_build                   |    8 +-
 source4/dsdb/samdb/ldb_modules/operational.c |    2 -
 source4/dsdb/samdb/ldb_modules/wscript_build |    2 +-
 source4/dynconfig/dynconfig.c                |    1 +
 source4/dynconfig/dynconfig.h                |    1 +
 source4/dynconfig/wscript                    |    4 +-
 source4/kdc/wscript_build                    |   10 ++--
 source4/rpc_server/wscript_build             |    2 +-
 source4/samba_tool/wscript_build             |    2 +-
 source4/torture/wscript_build                |    2 +-
 source4/utils/wscript_build                  |    2 +-
 wscript                                      |    4 +-
 33 files changed, 263 insertions(+), 131 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba3.py b/buildtools/wafsamba/samba3.py
index 5008abb..6759450 100644
--- a/buildtools/wafsamba/samba3.py
+++ b/buildtools/wafsamba/samba3.py
@@ -1,9 +1,9 @@
 # a waf tool to add autoconf-like macros to the configure section
 # and for SAMBA_ macros for building libraries, binaries etc
 
-import Options
-import Build
+import Options, Build, os
 from optparse import SUPPRESS_HELP
+from samba_utils import os_path_relpath, TO_LIST
 
 def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True,
                       with_name="with", without_name="without"):
@@ -41,3 +41,73 @@ def SAMBA3_IS_ENABLED_MODULE(bld, module):
     '''Check whether module is in either shared or static list '''
     return SAMBA3_IS_STATIC_MODULE(bld, module) or SAMBA3_IS_SHARED_MODULE(bld, module)
 Build.BuildContext.SAMBA3_IS_ENABLED_MODULE = SAMBA3_IS_ENABLED_MODULE
+
+
+
+def s3_fix_kwargs(bld, kwargs):
+    '''fix the build arguments for s3 build rules to include the
+	necessary includes, subdir and cflags options '''
+    s3dir = os.path.join(bld.env.srcdir, 'source3')
+    s3reldir = os_path_relpath(s3dir, bld.curdir)
+
+    # cope with the fact that the s3 waf rules were originally written
+    # assuming relative paths to source3/. This only triggers when using the
+    # wscript rules in s3build/
+    if bld.curdir.endswith("/s3build") and not 'subdir' in kwargs:
+        kwargs['subdir'] = s3reldir
+
+    # the extra_includes list is relative to the source3 directory
+    extra_includes = [ '.', 'include', 'lib' ]
+    if bld.env.use_intree_heimdal:
+        extra_includes += [ '../source4/heimdal/lib/com_err',
+                            '../source4/heimdal/lib/gssapi',
+                            '../source4/heimdal_build' ]
+
+    if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
+        extra_includes += [ '../lib/tdb/include' ]
+
+    if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
+        extra_includes += [ '../lib/tevent' ]
+
+    if not bld.CONFIG_SET('USING_SYSTEM_TALLOC'):
+        extra_includes += [ '../lib/talloc' ]
+
+    # s3 builds assume that they will have a bunch of extra include paths
+    includes = []
+    for d in extra_includes:
+        includes += [ os.path.join(s3reldir, d) ]
+
+    # the rule may already have some includes listed
+    if 'includes' in kwargs:
+        includes += TO_LIST(kwargs['includes'])
+    kwargs['includes'] = includes
+
+    # some S3 code assumes that CONFIGFILE is set
+    cflags = ['-DCONFIGFILE="%s"' % bld.env['CONFIGFILE']]
+    if 'cflags' in kwargs:
+        cflags += TO_LIST(kwargs['cflags'])
+    kwargs['cflags'] = cflags
+
+# these wrappers allow for mixing of S3 and S4 build rules in the one build
+
+def SAMBA3_LIBRARY(bld, name, *args, **kwargs):
+	s3_fix_kwargs(bld, kwargs)
+	kwargs['allow_undefined_symbols'] = True
+	return bld.SAMBA_LIBRARY(name, *args, **kwargs)
+Build.BuildContext.SAMBA3_LIBRARY = SAMBA3_LIBRARY
+
+def SAMBA3_MODULE(bld, name, *args, **kwargs):
+	s3_fix_kwargs(bld, kwargs)
+	kwargs['allow_undefined_symbols'] = True
+	return bld.SAMBA_MODULE(name, *args, **kwargs)
+Build.BuildContext.SAMBA3_MODULE = SAMBA3_MODULE
+
+def SAMBA3_SUBSYSTEM(bld, name, *args, **kwargs):
+	s3_fix_kwargs(bld, kwargs)
+	return bld.SAMBA_SUBSYSTEM(name, *args, **kwargs)
+Build.BuildContext.SAMBA3_SUBSYSTEM = SAMBA3_SUBSYSTEM
+
+def SAMBA3_BINARY(bld, name, *args, **kwargs):
+	s3_fix_kwargs(bld, kwargs)
+	return bld.SAMBA_BINARY(name, *args, **kwargs)
+Build.BuildContext.SAMBA3_BINARY = SAMBA3_BINARY
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index bd074f8..ebd5210 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -197,6 +197,8 @@ def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript, abi_match=None):
     else:
         source = ''
 
+    libname = os.path.basename(libname)
+    version = os.path.basename(version)
     libname = libname.replace("-", "_").replace("+","_").upper()
     version = version.replace("-", "_").replace("+","_").upper()
 
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index ec0ed16..02b52df 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -463,21 +463,22 @@ Build.BuildContext.CONFIG_SET = CONFIG_SET
 Build.BuildContext.CONFIG_GET = CONFIG_GET
 
 
-def library_flags(conf, libs):
+def library_flags(self, libs):
     '''work out flags from pkg_config'''
     ccflags = []
     ldflags = []
     for lib in TO_LIST(libs):
-        inc_path = getattr(conf.env, 'CPPPATH_%s' % lib.upper(), [])
-        lib_path = getattr(conf.env, 'LIBPATH_%s' % lib.upper(), [])
+        inc_path = getattr(self.env, 'CPPPATH_%s' % lib.upper(), [])
+        lib_path = getattr(self.env, 'LIBPATH_%s' % lib.upper(), [])
         ccflags.extend(['-I%s' % i for i in inc_path])
         ldflags.extend(['-L%s' % l for l in lib_path])
-        extra_ccflags = TO_LIST(getattr(conf.env, 'CCFLAGS_%s' % lib.upper(), []))
-        extra_ldflags = TO_LIST(getattr(conf.env, 'LDFLAGS_%s' % lib.upper(), []))
+        extra_ccflags = TO_LIST(getattr(self.env, 'CCFLAGS_%s' % lib.upper(), []))
+        extra_ldflags = TO_LIST(getattr(self.env, 'LDFLAGS_%s' % lib.upper(), []))
         ccflags.extend(extra_ccflags)
         ldflags.extend(extra_ldflags)
-    if 'EXTRA_LDFLAGS' in conf.env:
-        ldflags.extend(conf.env['EXTRA_LDFLAGS'])
+    if 'EXTRA_LDFLAGS' in self.env:
+        ldflags.extend(self.env['EXTRA_LDFLAGS'])
+
     ccflags = unique_list(ccflags)
     ldflags = unique_list(ldflags)
     return (ccflags, ldflags)
@@ -644,6 +645,8 @@ def ADD_CFLAGS(conf, flags, testflags=False):
 def ADD_LDFLAGS(conf, flags, testflags=False):
     '''add some LDFLAGS to the command line
        optionally set testflags to ensure all the flags work
+
+       this will return the flags that are added, if any
     '''
     if testflags:
         ok_flags=[]
@@ -654,7 +657,7 @@ def ADD_LDFLAGS(conf, flags, testflags=False):
     if not 'EXTRA_LDFLAGS' in conf.env:
         conf.env['EXTRA_LDFLAGS'] = []
     conf.env['EXTRA_LDFLAGS'].extend(TO_LIST(flags))
-
+    return flags
 
 
 @conf
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 188c2dd..a3968ad 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -85,6 +85,10 @@ def build_dependencies(self):
         new_ldflags.extend(ldflags)
         self.ldflags       = new_ldflags
 
+        if getattr(self, 'allow_undefined_symbols', False) and self.env.undefined_ldflags:
+            for f in self.env.undefined_ldflags:
+                self.ldflags.remove(f)
+
         debug('deps: computed dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
               self.sname, self.uselib, self.uselib_local, self.add_objects)
 
@@ -288,8 +292,7 @@ def check_duplicate_sources(bld, tgt_list):
             Logs.warn("WARNING: source %s is in more than one target: %s" % (s, subsystems[s].keys()))
         for tname in subsystems[s]:
             if len(subsystems[s][tname]) > 1:
-                Logs.error("ERROR: source %s is in more than one subsystem of target '%s': %s" % (s, tname, subsystems[s][tname]))
-                sys.exit(1)
+                raise Utils.WafError("ERROR: source %s is in more than one subsystem of target '%s': %s" % (s, tname, subsystems[s][tname]))
                 
     return ret
 
@@ -955,7 +958,7 @@ def show_object_duplicates(bld, tgt_list):
 # this provides a way to save our dependency calculations between runs
 savedeps_version = 3
 savedeps_inputs  = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags',
-                    'source', 'grouping_library', 'samba_ldflags']
+                    'source', 'grouping_library', 'samba_ldflags', 'allow_undefined_symbols' ]
 savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags', 'ldflags', 'samba_deps_extended']
 savedeps_outenv  = ['INC_PATHS']
 savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES', 'EXTRA_CFLAGS', 'EXTRA_LDFLAGS', 'EXTRA_INCLUDES' ]
diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
index 5902d73..3e055d7 100644
--- a/buildtools/wafsamba/samba_install.py
+++ b/buildtools/wafsamba/samba_install.py
@@ -182,7 +182,7 @@ def symlink_lib(self):
 
     link_target = getattr(self, 'link_name', '')
     if link_target == '':
-        basename = self.bld.make_libname(self.target, version=soext)
+        basename = os.path.basename(self.bld.make_libname(self.target, version=soext))
         if getattr(self, "private_library", False):
             link_target = '%s/private/%s' % (LIB_PATH, basename)
         else:
@@ -211,6 +211,8 @@ def symlink_bin(self):
         return
 
     blddir = os.path.dirname(self.bld.srcnode.abspath(self.bld.env))
+    if not self.link_task.outputs or not self.link_task.outputs[0]:
+        raise Utils.WafError('no outputs found for %s in symlink_bin' % self.name)
     binpath = self.link_task.outputs[0].abspath(self.env)
     bldpath = os.path.join(self.bld.env.BUILD_DIRECTORY, self.link_task.outputs[0].name)
 
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index b1ddc5a..54ceba9 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -560,6 +560,13 @@ def map_shlib_extension(ctx, name, python=False):
     return root1+ext2
 Build.BuildContext.map_shlib_extension = map_shlib_extension
 
+def apply_pattern(filename, pattern):
+    '''apply a filename pattern to a filename that may have a directory component'''
+    dirname = os.path.dirname(filename)
+    if not dirname:
+        return pattern % filename
+    basename = os.path.basename(filename)
+    return os.path.join(dirname, pattern % basename)
 
 def make_libname(ctx, name, nolibprefix=False, version=None, python=False):
     """make a library filename
@@ -569,9 +576,9 @@ def make_libname(ctx, name, nolibprefix=False, version=None, python=False):
               python     : if we should use python module name conventions"""
 
     if python:
-        libname = ctx.env.pyext_PATTERN % name
+        libname = apply_pattern(name, ctx.env.pyext_PATTERN)
     else:
-        libname = ctx.env.shlib_PATTERN % name
+        libname = apply_pattern(name, ctx.env.shlib_PATTERN)
     if nolibprefix and libname[0:3] == 'lib':
         libname = libname[3:]
     if version:
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index be8cad3..8c42966 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -110,6 +110,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   depends_on='',
                   local_include=True,
                   vars=None,
+                  subdir=None,
                   install_path=None,
                   install=True,
                   pyembed=False,
@@ -123,6 +124,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   manpages=None,
                   private_library=False,
                   grouping_library=False,
+                  allow_undefined_symbols=False,
                   enabled=True):
     '''define a Samba library'''
 
@@ -131,6 +133,8 @@ def SAMBA_LIBRARY(bld, libname, source,
         return
 
     source = bld.EXPAND_VARIABLES(source, vars=vars)
+    if subdir:
+        source = bld.SUBDIR(subdir, source)
 
     # remember empty libraries, so we can strip the dependencies
     if ((source == '') or (source == [])) and deps == '' and public_deps == '':
@@ -213,11 +217,17 @@ def SAMBA_LIBRARY(bld, libname, source,
             vscript = "%s.vscript" % libname
             bld.ABI_VSCRIPT(libname, abi_directory, version, vscript,
                             abi_match)
-            fullname = bld.env.shlib_PATTERN % bundled_name
-            bld.add_manual_dependency(bld.path.find_or_declare(fullname), bld.path.find_or_declare(vscript))
+            fullname = apply_pattern(bundled_name, bld.env.shlib_PATTERN)
+            fullpath = bld.path.find_or_declare(fullname)
+            vscriptpath = bld.path.find_or_declare(vscript)
+            if not fullpath:
+                raise Utils.WafError("unable to find fullpath for %s" % fullname)
+            if not vscriptpath:
+                raise Utils.WafError("unable to find vscript path for %s" % vscript)
+            bld.add_manual_dependency(fullpath, vscriptpath)
             if Options.is_install:
                 # also make the .inst file depend on the vscript
-                instname = bld.env.shlib_PATTERN % (bundled_name + '.inst')
+                instname = apply_pattern(bundled_name + '.inst', bld.env.shlib_PATTERN)
                 bld.add_manual_dependency(bld.path.find_or_declare(instname), bld.path.find_or_declare(vscript))
             vscript = os.path.join(bld.path.abspath(bld.env), vscript)
 
@@ -242,7 +252,8 @@ def SAMBA_LIBRARY(bld, libname, source,
         abi_directory   = "%s/%s" % (bld.path.abspath(), abi_directory),
         abi_match       = abi_match,
         private_library = private_library,
-        grouping_library=grouping_library
+        grouping_library=grouping_library,
+        allow_undefined_symbols=allow_undefined_symbols
         )
 
     if realname and not link_name:
@@ -280,6 +291,7 @@ def SAMBA_BINARY(bld, binname, source,
                  subsystem_name=None,
                  pyembed=False,
                  vars=None,
+                 subdir=None,
                  install=True,
                  install_path=None,
                  enabled=True):
@@ -299,6 +311,8 @@ def SAMBA_BINARY(bld, binname, source,
     obj_target = binname + '.objlist'
 
     source = bld.EXPAND_VARIABLES(source, vars=vars)
+    if subdir:
+        source = bld.SUBDIR(subdir, source)
     source = unique_list(TO_LIST(source))
 
     if group == 'binaries':
@@ -363,12 +377,16 @@ def SAMBA_MODULE(bld, modname, source,
                  internal_module=True,
                  local_include=True,
                  vars=None,
+                 subdir=None,
                  enabled=True,
                  pyembed=False,
+                 allow_undefined_symbols=False
                  ):
     '''define a Samba module.'''
 
     source = bld.EXPAND_VARIABLES(source, vars=vars)
+    if subdir:
+        source = bld.SUBDIR(subdir, source)
 
     if internal_module or BUILTIN_LIBRARY(bld, modname):
         bld.SAMBA_SUBSYSTEM(modname, source,
@@ -409,6 +427,7 @@ def SAMBA_MODULE(bld, modname, source,
     bld.SAMBA_LIBRARY(modname,
                       source,
                       deps=deps,
+                      includes=includes,
                       cflags=cflags,
                       realname = realname,
                       autoproto = autoproto,
@@ -417,6 +436,7 @@ def SAMBA_MODULE(bld, modname, source,
                       link_name=build_link_name,
                       install_path="${MODULESDIR}/%s" % subsystem,
                       pyembed=pyembed,
+                      allow_undefined_symbols=allow_undefined_symbols
                       )
 
 
@@ -444,6 +464,7 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
                     use_hostcc=False,
                     use_global_deps=True,
                     vars=None,
+                    subdir=None,
                     hide_symbols=False,
                     pyext=False):
     '''define a Samba subsystem'''
@@ -461,6 +482,8 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
         return
 
     source = bld.EXPAND_VARIABLES(source, vars=vars)
+    if subdir:
+        source = bld.SUBDIR(subdir, source)
     source = unique_list(TO_LIST(source))
 
     deps += ' ' + public_deps
diff --git a/lib/uid_wrapper/uid_wrapper.h b/lib/uid_wrapper/uid_wrapper.h
index 3d42223..b3b11d9 100644
--- a/lib/uid_wrapper/uid_wrapper.h
+++ b/lib/uid_wrapper/uid_wrapper.h
@@ -17,6 +17,7 @@
 
 #ifndef __UID_WRAPPER_H__
 #define __UID_WRAPPER_H__
+#ifndef uwrap_enabled
 
 int uwrap_enabled(void);
 int uwrap_seteuid(uid_t euid);
@@ -68,4 +69,5 @@ gid_t uwrap_getgid(void);
 #endif
 #define getgid	uwrap_getgid
 
+#endif
 #endif /* __UID_WRAPPER_H__ */
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h
index 92ea730..901885d 100644
--- a/lib/util/charset/charset.h
+++ b/lib/util/charset/charset.h
@@ -184,8 +184,11 @@ codepoint_t next_codepoint_convenience(struct smb_iconv_convenience *ic,
 			    const char *str, size_t *size);
 ssize_t push_codepoint_convenience(struct smb_iconv_convenience *ic, 
 				char *str, codepoint_t c);
+
 codepoint_t toupper_m(codepoint_t val);
 codepoint_t tolower_m(codepoint_t val);
+bool islower_m(codepoint_t val);
+bool isupper_m(codepoint_t val);
 int codepoint_cmpi(codepoint_t c1, codepoint_t c2);
 
 /* Iconv convenience functions */
diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c
index bc39f1b..5dc7614 100644
--- a/lib/util/charset/codepoints.c
+++ b/lib/util/charset/codepoints.c
@@ -20,7 +20,7 @@
 
 #include "includes.h"
 #include "system/locale.h"
-#include "dynconfig/dynconfig.h"
+#include "dynconfig.h"
 
 /**
  * @file
@@ -44,8 +44,8 @@ void load_case_tables(void)
 	if (!mem_ctx) {
 		smb_panic("No memory for case_tables");
 	}
-	upcase_table = map_file(talloc_asprintf(mem_ctx, "%s/upcase.dat", dyn_CODEPAGEDIR), 0x20000);
-	lowcase_table = map_file(talloc_asprintf(mem_ctx, "%s/lowcase.dat", dyn_CODEPAGEDIR), 0x20000);
+	upcase_table = map_file(talloc_asprintf(mem_ctx, "%s/upcase.dat", get_dyn_CODEPAGEDIR()), 0x20000);
+	lowcase_table = map_file(talloc_asprintf(mem_ctx, "%s/lowcase.dat", get_dyn_CODEPAGEDIR()), 0x20000);
 	talloc_free(mem_ctx);
 	if (upcase_table == NULL) {
 		upcase_table = (void *)-1;
@@ -96,6 +96,22 @@ _PUBLIC_ codepoint_t tolower_m(codepoint_t val)
 }
 
 /**
+ If we upper cased this character, would we get the same character?
+**/
+_PUBLIC_ bool islower_m(codepoint_t val)
+{
+	return (toupper_m(val) != val);
+}
+
+/**
+ If we lower cased this character, would we get the same character?
+**/
+_PUBLIC_ bool isupper_m(codepoint_t val)
+{
+	return (tolower_m(val) != val);
+}
+
+/**
   compare two codepoints case insensitively
 */
 _PUBLIC_ int codepoint_cmpi(codepoint_t c1, codepoint_t c2)
diff --git a/lib/util/charset/wscript_build b/lib/util/charset/wscript_build
index 56ed9a6..4137bf6 100644
--- a/lib/util/charset/wscript_build
+++ b/lib/util/charset/wscript_build
@@ -1,10 +1,14 @@
 #!/usr/bin/env python
 
 
-bld.SAMBA_SUBSYSTEM('CHARSET',
-	source='iconv.c charcnv.c util_unistr.c codepoints.c',
-	public_deps='iconv',
-	public_headers='charset.h',
+if bld.env._SAMBA_BUILD_ == 4:
+    bld.SAMBA_SUBSYSTEM('CHARSET',
+                        source='iconv.c charcnv.c util_unistr.c',
+                        public_deps='iconv CODEPOINTS',
+                        public_headers='charset.h',
+                        )
+
+bld.SAMBA_SUBSYSTEM('CODEPOINTS',
+	source='codepoints.c',
 	deps='DYNCONFIG'
 	)
-
diff --git a/lib/util/util.h b/lib/util/util.h
index 8f4fd8f..dc8a930 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -59,13 +59,6 @@ extern const char *panic_action;
 	    __FILE__, __LINE__, #b)); }} while (0)
 #endif
 
-#if _SAMBA_BUILD_ == 4
-#ifdef VALGRIND
-#define strlen(x) valgrind_strlen(x)
-size_t valgrind_strlen(const char *s);
-#endif
-#endif
-
 #ifndef ABS
 #define ABS(a) ((a)>0?(a):(-(a)))
 #endif
diff --git a/lib/util/util_str.c b/lib/util/util_str.c
index 0ea71a8..8695266 100644
--- a/lib/util/util_str.c
+++ b/lib/util/util_str.c
@@ -112,17 +112,6 @@ _PUBLIC_ char *safe_strcat(char *dest, const char *src, size_t maxlength)
 	return dest;
 }
 
-#ifdef VALGRIND


-- 
Samba Shared Repository


More information about the samba-cvs mailing list