[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Sep 5 14:10:04 MDT 2014


The branch, master has been updated
       via  8c3e0f8 script/autobuild.py: remove explicit --with-perl-*-install-dir options
       via  fac24e1 pidl: remove superfluous "use lib ...".
       via  b537c5a pidl: fix the perl module search path (use lib ...) when installing pidl.
       via  f73a0c2 wafsamba: add perl_fixup parameter to INSTALL_FILES
       via  e7fc38a s3:build: don't detect perl in source3/wscript again.
       via  191fc0e pidl/wscript: don't check for perl again.
       via  7bf9e93 build: do full SAMBA_CHECK_PERL() check in configure
       via  75c3e24 wafsamba: add samba_perl.py with SAMBA_CHECK_PERL() higher level check.
       via  6ad6781 dynconfig: implement PERL_ARCH_INSTALL_DIR
       via  e5d54c5 dynconfig: implement PERL_LIB_INSTALL_DIR.
       via  bb9a939 lib/ldb/wscript: pass dep_vars=['LDB_VERSION'] to SAMBA_GENERATOR()
       via  de0443a docs-xml/wscript_build: pass dep_vars=bld.dynconfig_varnames() to SAMBA_GENERATOR()
       via  32ddd5b dynconfig/wscript: add dynconfig_varnames()
       via  bab349c ctdb/wscript: pass dep_vars=['VERSION'] to SAMBA_GENERATOR()
       via  a41a9ad wafsamba: let SAMBA_BLDOPTIONS() use dep_vars=['defines'] instead of always=True
       via  7316653 wafsamba: fix dependencies on environment variables for python_fixup
       via  04bb8ff wafsamba: allow an optional dep_vars list to be passed to SAMBA_GENERATOR()
       via  da8c763 wafsamba: fix dependency for SAMBA_GENERATOR() when passing vars!=None
       via  ee8fbbd wafsamba: fix dependency calculation for SAMBA_GENERATOR()
       via  210d7de wafsamba: improve wording in a comment
       via  ca06fac wafsamba: remove unused variable from copy_and_fix_python_path
      from  2c57cc9 ctdb-call: Drop all deferred requests from older generation

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


- Log -----------------------------------------------------------------
commit 8c3e0f84ccafc6751777a9fa09a21d7be9af32cd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 26 21:32:17 2014 +0200

    script/autobuild.py: remove explicit --with-perl-*-install-dir options
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Fri Sep  5 22:09:47 CEST 2014 on sn-devel-104

commit fac24e11655c554cd3113dfb6fc918a0fd3c880c
Author: Michael Adam <obnox at samba.org>
Date:   Mon Aug 25 23:58:48 2014 +0200

    pidl: remove superfluous "use lib ...".
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit b537c5a340bae2accbf35a4ec5eab7074b90f0b1
Author: Michael Adam <obnox at samba.org>
Date:   Mon Aug 25 23:57:23 2014 +0200

    pidl: fix the perl module search path (use lib ...) when installing pidl.
    
    This way, pidl can also run with modules installed under the $prefix.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f73a0c2af9748d57721211472cd6c50b990ee693
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 17 16:54:54 2014 +0200

    wafsamba: add perl_fixup parameter to INSTALL_FILES
    
    This fixes the search path for modules when installing
    a perl "binary" by replacing a line 'use lib "$RealBin/lib";'
    which works for the build directory with the appropriate
    "use lib" line.
    
    This is a step in allowing to install perl modules under the
    prefix directory again.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit e7fc38a7df90e26a96ec5573042dccc1746e4f2c
Author: Michael Adam <obnox at samba.org>
Date:   Wed Aug 27 22:19:38 2014 +0200

    s3:build: don't detect perl in source3/wscript again.
    
    This is done in the top level now.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 191fc0e541e7c9d0a1095dc287402df9947ce779
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 4 01:38:14 2014 +0200

    pidl/wscript: don't check for perl again.
    
    This is done at the toplevel now.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 7bf9e937ae59e10a9b40be3a60ffaad49669fb83
Author: Michael Adam <obnox at samba.org>
Date:   Tue Aug 26 01:31:17 2014 +0200

    build: do full SAMBA_CHECK_PERL() check in configure
    
    ...instead of only checking for the perl binary
    
    This autodetects PERL_LIB_INSTALL_DIR and removes the
    need of the --with-perl-lib-install-dir when using a --prefix!=/usr.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 75c3e240e0703be8c86596e689e466b4dee5e85e
Author: Michael Adam <obnox at samba.org>
Date:   Tue Aug 26 01:29:57 2014 +0200

    wafsamba: add samba_perl.py with SAMBA_CHECK_PERL() higher level check.
    
    This checks for the perl binary, sets PERL and PERL_SPECIFIED
    as well es the PERL_ARCH_INSTALL_DIR and PERL_LIB_INSTALL_DIR.
    
    We want to avoid installing the perl modules outside the prefix.
    I.e. generally,the perl modules should be installed
    under "$prefix/share/perl5".
    
    This improves the fixes for bug #10472.
    
    The new strategy for automatically setting the paths is this:
    
    - if the prefix equals perl's vendorprefix, then
      - PERL_LIB_INSTALL_DIR is set to perl's vendorlib dir
      - PERL_ARCH_INSTALL_DIR is set to perl's vendorarch dir
    - otherwise:
      - PERL_LIB_INSTALL_DIR is set to ${DATADIR}/perl5
        (usually ${PREFIX}/share/perl5)
      - PERL_ARCH_INSTALL_DIR is set to ${LIBDIR}/perl5
        (usually ${PREFIX}/lib/perl5)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 6ad678166c85f0eb90b76ccf842d1aa8dcb6b41a
Author: Michael Adam <obnox at samba.org>
Date:   Tue Aug 26 00:41:54 2014 +0200

    dynconfig: implement PERL_ARCH_INSTALL_DIR
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit e5d54c5841c003d55960458da29635b3656884df
Author: Michael Adam <obnox at samba.org>
Date:   Mon Aug 25 23:59:46 2014 +0200

    dynconfig: implement PERL_LIB_INSTALL_DIR.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit bb9a939e78d54a4b09f38d1f7cec1544239fef34
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 27 10:29:50 2014 +0200

    lib/ldb/wscript: pass dep_vars=['LDB_VERSION'] to SAMBA_GENERATOR()
    
    bld.add_manual_dependency() only works for files not for environment variables.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit de0443ac7690923fa1731560fa51a551711f37fe
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 27 10:15:56 2014 +0200

    docs-xml/wscript_build: pass dep_vars=bld.dynconfig_varnames() to SAMBA_GENERATOR()
    
    This avoids the use of always=True.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 32ddd5b6559ad22b2ca84262c396dc889d661bab
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 27 10:13:09 2014 +0200

    dynconfig/wscript: add dynconfig_varnames()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit bab349c2a1d51409900f05144324d3da5dce4e99
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 27 10:10:34 2014 +0200

    ctdb/wscript: pass dep_vars=['VERSION'] to SAMBA_GENERATOR()
    
    This avoid the use of always=True.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit a41a9ad0749755d612df81bb77384b4f479e1af2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 27 10:08:21 2014 +0200

    wafsamba: let SAMBA_BLDOPTIONS() use dep_vars=['defines'] instead of always=True
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 7316653a82fea3dfe1ac8aa89003ce15836a11b9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 26 23:14:23 2014 +0200

    wafsamba: fix dependencies on environment variables for python_fixup
    
    We now checksum the sourcecode of copy_and_fix_python_path()
    and the env variables used by this function.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 04bb8ff7e6a3908b952d4d95edc2c7411611ac33
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 26 23:11:39 2014 +0200

    wafsamba: allow an optional dep_vars list to be passed to SAMBA_GENERATOR()
    
    This can be used to checksum variables used in the rule function.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit da8c76354549a64181cffc36e1c0bb0c6c4f87d3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 26 23:11:39 2014 +0200

    wafsamba: fix dependency for SAMBA_GENERATOR() when passing vars!=None
    
    vars can only be a dictionary as that's the only thing bld.EXPAND_VARIABLES()
    accepts.
    
    We need to checksum the whole vars dictionary into the dependencies.
    
    We set task.env.SAMBA_GENERATOR_VARS = vars and add SAMBA_GENERATOR_VARS
    to the dep_vars.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit ee8fbbd41741e958e0ab6d7b9ab465d664abac60
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 26 23:11:39 2014 +0200

    wafsamba: fix dependency calculation for SAMBA_GENERATOR()
    
    We need to checksum the rule as string command of the
    sourcecode of the python function.
    
    This is stored in the 'ruledeps' envariable on the waf Task.
    See exec_rule() in wafadmin/TaskGen.py.
    
        dep_vars = getattr(self, 'dep_vars', ['ruledeps'])
        if dep_vars:
            tsk.dep_vars = dep_vars
        if isinstance(self.rule, str):
            tsk.env.ruledeps = self.rule
        else:
            # only works if the function is in a global module such as a waf tool
            tsk.env.ruledeps = Utils.h_fun(self.rule)
    
    If there's no 'dep_vars' it defaults to ['ruledeps'].
    As we pass our own 'dep_vars' we need to explicitly add
    'ruledeps'.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 210d7de34f953c308e5fa3db9506796ef2b21688
Author: Michael Adam <obnox at samba.org>
Date:   Mon Aug 25 23:39:50 2014 +0200

    wafsamba: improve wording in a comment
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit ca06fac2c87d4abe884d2b6e3c1022266b06e287
Author: Michael Adam <obnox at samba.org>
Date:   Mon Aug 25 23:38:29 2014 +0200

    wafsamba: remove unused variable from copy_and_fix_python_path
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 buildtools/wafsamba/samba_patterns.py |    4 +-
 buildtools/wafsamba/samba_perl.py     |   62 ++++++++++++++++++++++++++++
 buildtools/wafsamba/wafsamba.py       |   71 +++++++++++++++++++++++++--------
 ctdb/wscript                          |   19 +++++----
 docs-xml/wscript_build                |    2 +-
 dynconfig/wscript                     |   20 +++++++++
 lib/ldb/wscript                       |    3 +-
 pidl/pidl                             |    1 -
 pidl/wscript                          |    5 +--
 script/autobuild.py                   |    9 +---
 source3/wscript                       |    1 -
 wscript                               |    2 +-
 12 files changed, 156 insertions(+), 43 deletions(-)
 create mode 100644 buildtools/wafsamba/samba_perl.py


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 9c0f653..b4427d3 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -205,6 +205,6 @@ def SAMBA_BLDOPTIONS(bld, target):
     '''generate the bld_options.c for Samba'''
     t = bld.SAMBA_GENERATOR(target,
                             rule=write_build_options,
-                            target=target,
-                            always=True)
+                            dep_vars=['defines'],
+                            target=target)
 Build.BuildContext.SAMBA_BLDOPTIONS = SAMBA_BLDOPTIONS
diff --git a/buildtools/wafsamba/samba_perl.py b/buildtools/wafsamba/samba_perl.py
new file mode 100644
index 0000000..3909aba
--- /dev/null
+++ b/buildtools/wafsamba/samba_perl.py
@@ -0,0 +1,62 @@
+import Build
+from samba_utils import *
+from Configure import conf
+
+done = {}
+
+ at conf
+def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
+    #
+    # TODO: use the @runonce mechanism for this.
+    # The problem is that @runonce currently does
+    # not seem to work together with @conf...
+    # So @runonce (and/or) @conf needs fixing.
+    #
+    if "done" in done:
+        return
+    done["done"] = True
+    conf.find_program('perl', var='PERL', mandatory=mandatory)
+    conf.check_tool('perl')
+    path_perl = conf.find_program('perl')
+    conf.env.PERL_SPECIFIED = (conf.env.PERL != path_perl)
+    conf.check_perl_version(version)
+
+    def read_perl_config_var(cmd):
+        return Utils.to_list(Utils.cmd_output([conf.env.PERL, '-MConfig', '-e', cmd]))
+
+    def check_perl_config_var(var):
+        conf.start_msg("Checking for perl $Config{%s}:" % var)
+        try:
+            v = read_perl_config_var('print $Config{%s}' % var)[0]
+            conf.end_msg("'%s'" % (v), 'GREEN')
+            return v
+        except IndexError:
+            conf.end_msg(False, 'YELLOW')
+            pass
+        return None
+
+    vendor_prefix = check_perl_config_var('vendorprefix')
+
+    perl_arch_install_dir = None
+    if vendor_prefix == conf.env.PREFIX:
+        perl_arch_install_dir = check_perl_config_var('vendorarch');
+    if perl_arch_install_dir is None:
+        perl_arch_install_dir = "${LIBDIR}/perl5";
+    conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
+    conf.end_msg("'%s'" % (perl_arch_install_dir), 'GREEN')
+    conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir
+
+    perl_lib_install_dir = None
+    if vendor_prefix == conf.env.PREFIX:
+        perl_lib_install_dir = check_perl_config_var('vendorlib');
+    if perl_lib_install_dir is None:
+        perl_lib_install_dir = "${DATADIR}/perl5";
+    conf.start_msg("PERL_LIB_INSTALL_DIR: ")
+    conf.end_msg("'%s'" % (perl_lib_install_dir), 'GREEN')
+    conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir
+
+    perl_inc = read_perl_config_var('print "@INC"')
+    perl_inc.remove('.')
+    conf.start_msg("PERL_INC: ")
+    conf.end_msg("%s" % (perl_inc), 'GREEN')
+    conf.env.PERL_INC = perl_inc
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index a2b8eea..f86ac61 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -16,6 +16,7 @@ from samba_patterns import *
 from samba_pidl import *
 from samba_autoproto import *
 from samba_python import *
+from samba_perl import *
 from samba_deps import *
 from samba_bundled import *
 from samba_third_party import *
@@ -589,6 +590,7 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='',
                     public_headers_install=True,
                     header_path=None,
                     vars=None,
+                    dep_vars=[],
                     always=False):
     '''A generic source generator target'''
 
@@ -598,11 +600,8 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='',
     if not enabled:
         return
 
-    dep_vars = []
-    if isinstance(vars, dict):
-        dep_vars = vars.keys()
-    elif isinstance(vars, list):
-        dep_vars = vars
+    dep_vars.append('ruledeps')
+    dep_vars.append('SAMBA_GENERATOR_VARS')
 
     bld.SET_BUILD_GROUP(group)
     t = bld(
@@ -614,9 +613,13 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='',
         before='cc',
         ext_out='.c',
         samba_type='GENERATOR',
-        dep_vars = [rule] + dep_vars,
+        dep_vars = dep_vars,
         name=name)
 
+    if vars is None:
+        vars = {}
+    t.env.SAMBA_GENERATOR_VARS = vars
+
     if always:
         t.always = True
 
@@ -712,8 +715,6 @@ def copy_and_fix_python_path(task):
         replacement="""sys.path.insert(0, "%s")
 sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
 
-    shebang = None
-
     if task.env["PYTHON"][0] == "/":
         replacement_shebang = "#!%s\n" % task.env["PYTHON"]
     else:
@@ -735,9 +736,38 @@ sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
     os.chmod(installed_location, 0755)
     return 0
 
+def copy_and_fix_perl_path(task):
+    pattern='use lib "$RealBin/lib";'
+
+    replacement = ""
+    if not task.env["PERL_LIB_INSTALL_DIR"] in task.env["PERL_INC"]:
+         replacement = 'use lib "%s";' % task.env["PERL_LIB_INSTALL_DIR"]
+
+    if task.env["PERL"][0] == "/":
+        replacement_shebang = "#!%s\n" % task.env["PERL"]
+    else:
+        replacement_shebang = "#!/usr/bin/env %s\n" % task.env["PERL"]
+
+    installed_location=task.outputs[0].bldpath(task.env)
+    source_file = open(task.inputs[0].srcpath(task.env))
+    installed_file = open(installed_location, 'w')
+    lineno = 0
+    for line in source_file:
+        newline = line
+        if lineno == 0 and task.env["PERL_SPECIFIED"] == True and line[:2] == "#!":
+            newline = replacement_shebang
+        elif pattern in line:
+            newline = line.replace(pattern, replacement)
+        installed_file.write(newline)
+        lineno = lineno + 1
+    installed_file.close()
+    os.chmod(installed_location, 0755)
+    return 0
+
 
 def install_file(bld, destdir, file, chmod=MODE_644, flat=False,
-                 python_fixup=False, destname=None, base_name=None):
+                 python_fixup=False, perl_fixup=False,
+                 destname=None, base_name=None):
     '''install a file'''
     destdir = bld.EXPAND_VARIABLES(destdir)
     if not destname:
@@ -746,16 +776,22 @@ def install_file(bld, destdir, file, chmod=MODE_644, flat=False,
             destname = os.path.basename(destname)
     dest = os.path.join(destdir, destname)
     if python_fixup:
-        # fixup the python path it will use to find Samba modules
+        # fix the path python will use to find Samba modules
         inst_file = file + '.inst'
         bld.SAMBA_GENERATOR('python_%s' % destname,
                             rule=copy_and_fix_python_path,
+                            dep_vars=["PYTHON","PYTHON_SPECIFIED","PYTHONDIR","PYTHONARCHDIR"],
+                            source=file,
+                            target=inst_file)
+        file = inst_file
+    if perl_fixup:
+        # fix the path perl will use to find Samba modules
+        inst_file = file + '.inst'
+        bld.SAMBA_GENERATOR('perl_%s' % destname,
+                            rule=copy_and_fix_perl_path,
+                            dep_vars=["PERL","PERL_SPECIFIED","PERL_LIB_INSTALL_DIR"],
                             source=file,
                             target=inst_file)
-        bld.add_manual_dependency(bld.path.find_or_declare(inst_file), bld.env["PYTHONARCHDIR"])
-        bld.add_manual_dependency(bld.path.find_or_declare(inst_file), bld.env["PYTHONDIR"])
-        bld.add_manual_dependency(bld.path.find_or_declare(inst_file), str(bld.env["PYTHON_SPECIFIED"]))
-        bld.add_manual_dependency(bld.path.find_or_declare(inst_file), bld.env["PYTHON"])
         file = inst_file
     if base_name:
         file = os.path.join(base_name, file)
@@ -763,12 +799,13 @@ def install_file(bld, destdir, file, chmod=MODE_644, flat=False,
 
 
 def INSTALL_FILES(bld, destdir, files, chmod=MODE_644, flat=False,
-                  python_fixup=False, destname=None, base_name=None):
+                  python_fixup=False, perl_fixup=False,
+                  destname=None, base_name=None):
     '''install a set of files'''
     for f in TO_LIST(files):
         install_file(bld, destdir, f, chmod=chmod, flat=flat,
-                     python_fixup=python_fixup, destname=destname,
-                     base_name=base_name)
+                     python_fixup=python_fixup, perl_fixup=perl_fixup,
+                     destname=destname, base_name=base_name)
 Build.BuildContext.INSTALL_FILES = INSTALL_FILES
 
 
diff --git a/ctdb/wscript b/ctdb/wscript
index 9c7d697..9fc9671 100755
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -171,10 +171,11 @@ def build(bld):
     bld.RECURSE('lib/tdb')
     bld.RECURSE('lib/socket_wrapper')
 
-    bld.SAMBA_GENERATOR('ctdb-version-header',
-                        target='include/ctdb_version.h',
-                        rule='../packaging/mkversion.sh ${TGT} %s' % (VERSION),
-                        always=True)
+    t = bld.SAMBA_GENERATOR('ctdb-version-header',
+                            target='include/ctdb_version.h',
+                            rule='../packaging/mkversion.sh ${TGT} %s' % (VERSION),
+                            dep_vars=['VERSION'])
+    t.env.VERSION = VERSION
 
     bld.SAMBA_SUBSYSTEM('ctdb-util',
                         source=bld.SUBDIR('lib/util',
@@ -414,10 +415,12 @@ def build(bld):
     bld.install_dir(bld.env.CTDB_VARDIR)
 
     sed_expr = 's/@PACKAGE_VERSION@/%s/g' % VERSION
-    bld.SAMBA_GENERATOR('ctdb-pc',
-                        source='ctdb.pc.in',
-                        target='ctdb.pc',
-                        rule='sed -e "%s" ${SRC} > ${TGT}' % sed_expr)
+    t = bld.SAMBA_GENERATOR('ctdb-pc',
+                            source='ctdb.pc.in',
+                            target='ctdb.pc',
+                            rule='sed -e "%s" ${SRC} > ${TGT}' % sed_expr,
+                            dep_vars=['VERSION'])
+    t.env.VERSION = VERSION
     bld.INSTALL_FILES('${LIBDIR}/pkgconfig', 'ctdb.pc')
 
     # Test binaries
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index e7c8931..f7d0db8 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -123,7 +123,7 @@ bld.SAMBA_GENERATOR(parameter_all,
                     source=articles,
                     target=parameter_all,
                     rule=smbdotconf_generate_parameter_list,
-                    always=True)
+                    dep_vars=bld.dynconfig_varnames())
 
 def SMBDOTCONF_MANPAGE(bld, target):
     ''' assemble and build smb.conf.5 manual page'''
diff --git a/dynconfig/wscript b/dynconfig/wscript
index a7cfa0a..6410c38 100755
--- a/dynconfig/wscript
+++ b/dynconfig/wscript
@@ -111,6 +111,16 @@ dynconfig = {
          'FHS-PATH':  '${PYTHONARCHDIR}',
          'OVERWRITE': True,
     },
+    'PERL_LIB_INSTALL_DIR' : {
+         'STD-PATH':  '${PERL_LIB_INSTALL_DIR}',
+         'FHS-PATH':  '${PERL_LIB_INSTALL_DIR}',
+         'OVERWRITE': True,
+    },
+    'PERL_ARCH_INSTALL_DIR' : {
+         'STD-PATH':  '${PERL_ARCH_INSTALL_DIR}',
+         'FHS-PATH':  '${PERL_ARCH_INSTALL_DIR}',
+         'OVERWRITE': True,
+    },
     'INCLUDEDIR' : {
          'STD-PATH':  '${INCLUDEDIR}',
          'FHS-PATH':  '${INCLUDEDIR}/samba-4.0',
@@ -372,6 +382,16 @@ def dynconfig_cflags(bld, list=None):
     return cflags
 Build.BuildContext.dynconfig_cflags = dynconfig_cflags
 
+def dynconfig_varnames(bld, list=None):
+    '''work out the dynconfig variables'''
+    varnames = []
+    for varname in dynconfig.keys():
+        if list and not varname in list:
+            continue
+        varnames.append(varname)
+    return varnames
+Build.BuildContext.dynconfig_varnames = dynconfig_varnames
+
 def pathconfig_entities(bld, list=None):
     '''work out the extra entities for the docs'''
     entities = []
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 6d9e845..027c8cb 100755
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -161,12 +161,11 @@ def build(bld):
         # generate a include/ldb_version.h
         t = bld.SAMBA_GENERATOR('ldb_version.h',
                                 rule='echo "#define LDB_VERSION \\"${LDB_VERSION}\\"" > ${TGT}',
+                                dep_vars=['LDB_VERSION'],
                                 target='include/ldb_version.h',
                                 public_headers='include/ldb_version.h',
                                 public_headers_install=not private_library)
         t.env.LDB_VERSION = VERSION
-        bld.add_manual_dependency(bld.path.find_or_declare('include/ldb_version.h'), VERSION)
-
 
 
         bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
diff --git a/pidl/pidl b/pidl/pidl
index c65092e..b7dcc2a 100755
--- a/pidl/pidl
+++ b/pidl/pidl
@@ -404,7 +404,6 @@ pidl README by Andrew Tridgell.
 use strict;
 use FindBin qw($RealBin $Script);
 use lib "$RealBin/lib";
-use lib "$RealBin/../share/perl5";
 use Getopt::Long;
 use File::Basename;
 use Parse::Pidl qw ( $VERSION );
diff --git a/pidl/wscript b/pidl/wscript
index 4965870..0d7626c 100644
--- a/pidl/wscript
+++ b/pidl/wscript
@@ -29,9 +29,6 @@ def set_options(opt):
     opt.tool_options('perl')
 
 def configure(conf):
-    conf.check_tool('perl')
-    conf.check_perl_ext_devel()
-
     # Check if perl(Parse::Yapp::Driver) is available.
     check_system_perl_module(conf, "Parse::Yapp::Driver", 1.05)
 
@@ -46,7 +43,7 @@ def configure(conf):
     conf.find_program('pod2man', var='POD2MAN')
 
 def build(bld):
-    bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=MODE_755)
+    bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=MODE_755, perl_fixup=True)
 
     bld.RECURSE('lib')
 
diff --git a/script/autobuild.py b/script/autobuild.py
index 786286b..c5d3cad 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -44,7 +44,7 @@ tasks = {
                ("clean", "make clean", "text/plain") ],
 
     # We have 'test' before 'install' because, 'test' should work without 'install'
-    "samba" : [ ("configure", "./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab", "text/plain"),
+    "samba" : [ ("configure", "./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab", "text/plain"),
                 ("make", "make -j", "text/plain"),
                 ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"),
                 ("install", "make install", "text/plain"),
@@ -65,7 +65,7 @@ tasks = {
                      ("ctdb-header-ls", "ls ${PREFIX_DIR}/include/ctdb.h", "text/plain"),
 
                      # build samba with cluster support against this ctdb:
-                     ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"),
+                     ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"),
                      ("samba-make", "make", "text/plain"),
                      ("samba-check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"),
                      ("samba-install", "make install", "text/plain"),
@@ -97,7 +97,7 @@ tasks = {
                       ("ldb-make", "cd lib/ldb && make", "text/plain"),
                       ("ldb-install", "cd lib/ldb && make install", "text/plain"),
 
-                      ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ntdb,!pyntdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX} ${PERL_VENDOR_LIB}", "text/plain"),
+                      ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ntdb,!pyntdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
                       ("make", "make", "text/plain"),
                       ("install", "make install", "text/plain"),
                       ("dist", "make dist", "text/plain")],
@@ -228,9 +228,6 @@ class builder(object):
         self.cmd = self.cmd.replace("${PYTHON_PREFIX}", get_python_lib(standard_lib=1, prefix=self.prefix))
         self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix)
         self.cmd = self.cmd.replace("${PREFIX_DIR}", "%s" % self.prefix)
-        perl_vendor_lib = "--with-perl-arch-install-dir=%s/share/perl5 " % self.prefix
-        perl_vendor_lib += "--with-perl-lib-install-dir=%s/lib/perl5" % self.prefix
-        self.cmd = self.cmd.replace("${PERL_VENDOR_LIB}", perl_vendor_lib)
 #        if self.output_mime_type == "text/x-subunit":
 #            self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
         print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd)
diff --git a/source3/wscript b/source3/wscript
index dce5da2..44cce16 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -586,7 +586,6 @@ msg.msg_accrightslen = sizeof(fd);
         conf.DEFINE('WITH_WINBIND', '1')
 
     conf.find_program('awk', var='AWK')
-    conf.find_program('perl', var='PERL')
 
     conf.CHECK_HEADERS('asm/types.h')
 
diff --git a/wscript b/wscript
index 7b43c58..73c113c 100644
--- a/wscript
+++ b/wscript
@@ -99,7 +99,7 @@ def configure(conf):
     conf.env.replace_add_global_pthread = True
     conf.RECURSE('lib/replace')
 
-    conf.find_program('perl', var='PERL', mandatory=True)
+    conf.SAMBA_CHECK_PERL(mandatory=True)
     conf.find_program('xsltproc', var='XSLTPROC')
 
     conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2,5,0))


-- 
Samba Shared Repository


More information about the samba-cvs mailing list