From 7e941829129a716768009f11f06e165496f07c29 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Tue, 7 Jan 2014 16:08:50 +1300 Subject: [PATCH 01/30] docs: update XInclude year to conform with current standard This allows the inbuilt python XML parser to handle these includes. Signed-off-by: Garming Sam Signed-off-by: Andrew Bartlett Reviewed-by: Michael Adam (cherry picked from commit 02379369ef7968f297b8678c9743679b4775662e) --- docs-xml/wscript_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build index 9c6042f..59a5371 100644 --- a/docs-xml/wscript_build +++ b/docs-xml/wscript_build @@ -97,7 +97,7 @@ def smbdotconf_generate_parameter_list(task): parameter_all = task.outputs[0].bldpath(task.env) articles = task.inputs - t = '
\n' + t = '
\n' for article in articles: t += "\n" t += "
\n" -- 1.9.1 From 733b6731d7b9c1ac5ea3520e076cd21dc6e8e2de Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Tue, 7 Jan 2014 17:09:39 +1300 Subject: [PATCH 02/30] docs: remove the file prefix from included path names This allows the inbuilt python xml modules to perform the include. Signed-off-by: Garming Sam Signed-off-by: Andrew Bartlett Reviewed-by: Michael Adam (cherry picked from commit 1d68b5b0bb3158cabcd371ab5c24392bcb0a32bd) --- docs-xml/wscript_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build index 59a5371..0664ade 100644 --- a/docs-xml/wscript_build +++ b/docs-xml/wscript_build @@ -99,7 +99,7 @@ def smbdotconf_generate_parameter_list(task): t = '
\n' for article in articles: - t += "\n" + t += "\n" t += "
\n" save_file(parameter_all, t , create_dir=True) return 0 -- 1.9.1 From 1f6158a8bd03a1b500c0abdb064f4e70b23e87aa Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Thu, 9 Jan 2014 12:01:18 +1300 Subject: [PATCH 03/30] docs: define and include entities for the docs This allows for dynamic default settings to be generated. Change-Id: If8b93d233fb941bc7e3073ccf4b5ec0b0a231bd9 Pair-programmed-with: Andrew Bartlett Signed-off-by: Garming Sam Signed-off-by: Andrew Bartlett Reviewed-by: Michael Adam (cherry picked from commit 57ba012c10fb21f261a3ab9136be05a694278df9) --- buildtools/wafsamba/wafsamba.py | 6 ++++-- docs-xml/wscript_build | 19 +++++++++++++++---- dynconfig/wscript | 35 +++++++++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index aaa0939..9ead232 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -804,7 +804,7 @@ def MANPAGES(bld, manpages, install): bld.INSTALL_FILES('${MANDIR}/man%s' % m[-1], m, flat=True) Build.BuildContext.MANPAGES = MANPAGES -def SAMBAMANPAGES(bld, manpages): +def SAMBAMANPAGES(bld, manpages, extra_source=None): '''build and install manual pages''' bld.env.SAMBA_EXPAND_XSL = bld.srcnode.abspath() + '/docs-xml/xslt/expand-sambadoc.xsl' bld.env.SAMBA_MAN_XSL = bld.srcnode.abspath() + '/docs-xml/xslt/man.xsl' @@ -812,13 +812,15 @@ def SAMBAMANPAGES(bld, manpages): for m in manpages.split(): source = m + '.xml' + if extra_source is not None: + source = [source, extra_source] bld.SAMBA_GENERATOR(m, source=source, target=m, group='final', rule='''XML_CATALOG_FILES="${SAMBA_CATALOGS}" export XML_CATALOG_FILES - ${XSLTPROC} --xinclude --stringparam noreference 0 -o ${TGT}.xml --nonet ${SAMBA_EXPAND_XSL} ${SRC} + ${XSLTPROC} --xinclude --stringparam noreference 0 -o ${TGT}.xml --nonet ${SAMBA_EXPAND_XSL} ${SRC[0].abspath(env)} ${XSLTPROC} --nonet -o ${TGT} ${SAMBA_MAN_XSL} ${TGT}.xml''' ) bld.INSTALL_FILES('${MANDIR}/man%s' % m[-1], m, flat=True) diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build index 0664ade..2822147 100644 --- a/docs-xml/wscript_build +++ b/docs-xml/wscript_build @@ -97,9 +97,19 @@ def smbdotconf_generate_parameter_list(task): parameter_all = task.outputs[0].bldpath(task.env) articles = task.inputs - t = '
\n' + entities = bld.pathconfig_entities() + t = "\n" + t += "
\n" for article in articles: - t += "\n" + f = open(article.abspath(task.env), 'r') + t += f.read() + f.close() + t += "
\n" save_file(parameter_all, t , create_dir=True) return 0 @@ -111,8 +121,9 @@ def SMBDOTCONF_MANPAGE(bld, target): bld.SAMBA_GENERATOR(parameter_all, source=articles, target=parameter_all, - rule=smbdotconf_generate_parameter_list) - bld.SAMBAMANPAGES(target) + rule=smbdotconf_generate_parameter_list, + always=True) + bld.SAMBAMANPAGES(target, parameter_all) if ('XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']): diff --git a/dynconfig/wscript b/dynconfig/wscript index aa4e66e..a7cfa0a 100755 --- a/dynconfig/wscript +++ b/dynconfig/wscript @@ -345,29 +345,48 @@ def configure(conf): conf.start_msg("Dynconfig[%s]: " % (varname)) conf.end_msg("'%s'" % (value), 'GREEN') -def dynconfig_cflags(bld, list=None): - '''work out the extra CFLAGS for dynconfig.c''' - cflags = [] - # override some paths when running from the build directory +def get_override(bld): override = { 'MODULESDIR' : 'bin/modules', 'PYTHONDIR' : 'bin/python', 'PYTHONARCHDIR' : 'bin/python', 'BINDIR' : 'bin', 'SBINDIR' : 'bin', - 'CODEPAGEDIR' : os.path.join(bld.env.srcdir, 'codepages'), - 'SCRIPTSBINDIR' : os.path.join(bld.env.srcdir, 'source4/scripting/bin'), - 'SETUPDIR' : os.path.join(bld.env.srcdir, 'source4/setup') } + 'CODEPAGEDIR' : 'codepages', + 'SCRIPTSBINDIR' : 'source4/scripting/bin', + 'SETUPDIR' : 'source4/setup' + } + return override + +def dynconfig_cflags(bld, list=None): + '''work out the extra CFLAGS for dynconfig.c''' + cflags = [] for varname in dynconfig.keys(): if list and not varname in list: continue value = bld.env[varname] if not Options.is_install: + override = get_override(bld) if varname in override: - value = os.path.join(os.getcwd(), override[varname]) + value = os.path.join(bld.env.srcdir, override[varname]) cflags.append('-D%s="%s"' % (varname, value)) return cflags Build.BuildContext.dynconfig_cflags = dynconfig_cflags +def pathconfig_entities(bld, list=None): + '''work out the extra entities for the docs''' + entities = [] + for varname in dynconfig.keys(): + if list and not varname in list: + continue + value = bld.env[varname] + if not Options.is_install: + override = get_override(bld) + if varname in override: + value = os.path.join(bld.env.srcdir, override[varname]) + entities.append("" % (varname, value)) + return entities +Build.BuildContext.pathconfig_entities = pathconfig_entities + def build(bld): cflags = bld.dynconfig_cflags() version_header = 'version.h' -- 1.9.1 From 3446ff7e87b9ce6e66ae882c3f4a32a645c35100 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 15 Jan 2014 18:11:41 +1300 Subject: [PATCH 04/30] docs: Always declare rule to build parameters.all.xml and do it first This ensures this file and the rule to generate it can always be found. Andrew Bartlett Change-Id: I76d9f4470e2678fc2df4e3a13642737128938f3a Signed-off-by: Garming Sam Signed-off-by: Andrew Bartlett Reviewed-by: Michael Adam (cherry picked from commit 2c86758b04515998c690f293fada2cc43116d764) --- docs-xml/wscript_build | 15 ++++++++------- wscript_build | 13 +++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build index 2822147..2c83a16 100644 --- a/docs-xml/wscript_build +++ b/docs-xml/wscript_build @@ -114,15 +114,16 @@ def smbdotconf_generate_parameter_list(task): save_file(parameter_all, t , create_dir=True) return 0 +articles = bld.path.ant_glob("smbdotconf/**/*.xml") +parameter_all = 'smbdotconf/parameters.all.xml' +bld.SAMBA_GENERATOR(parameter_all, + source=articles, + target=parameter_all, + rule=smbdotconf_generate_parameter_list, + always=True) + def SMBDOTCONF_MANPAGE(bld, target): ''' assemble and build smb.conf.5 manual page''' - articles = bld.path.ant_glob("smbdotconf/**/*.xml") - parameter_all = 'smbdotconf/parameters.all.xml' - bld.SAMBA_GENERATOR(parameter_all, - source=articles, - target=parameter_all, - rule=smbdotconf_generate_parameter_list, - always=True) bld.SAMBAMANPAGES(target, parameter_all) if ('XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']): diff --git a/wscript_build b/wscript_build index f0c9f2a..f28c08c 100644 --- a/wscript_build +++ b/wscript_build @@ -27,6 +27,13 @@ bld.SAMBA_MKVERSION('version.h') # bld.ENABLE_MAGIC_ORDERING() +bld.env.ABS_TOP_SRCDIR = bld.srcnode.abspath() + '/docs-xml' +bld.env.ABS_TOP_BUILDDIR = bld.srcnode.abspath() + '/bin/default/docs-xml' +bld.CONFIGURE_FILE('docs-xml/build/catalog.xml', + ABS_TOP_BUILDDIR = bld.env.ABS_TOP_BUILDDIR, + ABS_TOP_SRCDIR=bld.env.ABS_TOP_SRCDIR) +bld.RECURSE('docs-xml') + bld.RECURSE('lib/replace') bld.RECURSE('lib/socket') bld.RECURSE('lib/talloc') @@ -143,9 +150,3 @@ bld.RECURSE('testsuite/headers') bld.SYMBOL_CHECK() bld.DUP_SYMBOL_CHECK() -bld.env.ABS_TOP_SRCDIR = bld.srcnode.abspath() + '/docs-xml' -bld.env.ABS_TOP_BUILDDIR = bld.srcnode.abspath() + '/bin/default/docs-xml' -bld.CONFIGURE_FILE('docs-xml/build/catalog.xml', - ABS_TOP_BUILDDIR = bld.env.ABS_TOP_BUILDDIR, - ABS_TOP_SRCDIR=bld.env.ABS_TOP_SRCDIR) -bld.RECURSE('docs-xml') -- 1.9.1 From f05ae77e65cf7be09af80e614a206325c883cd89 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 25 Aug 2014 23:38:29 +0200 Subject: [PATCH 05/30] wafsamba: remove unused variable from copy_and_fix_python_path Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher (cherry picked from commit ca06fac2c87d4abe884d2b6e3c1022266b06e287) --- buildtools/wafsamba/wafsamba.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 9ead232..15d49b5 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -701,8 +701,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: -- 1.9.1 From bc0b25449ca9ae3bbd0c2afca4586eb0eefd71ac Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 25 Aug 2014 23:39:50 +0200 Subject: [PATCH 06/30] wafsamba: improve wording in a comment Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher (cherry picked from commit 210d7de34f953c308e5fa3db9506796ef2b21688) --- buildtools/wafsamba/wafsamba.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 15d49b5..d8588bc 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -733,7 +733,7 @@ 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, -- 1.9.1 From e7bb810f80e4d5f2dc0d78809139845d09ea18d7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Aug 2014 23:11:39 +0200 Subject: [PATCH 07/30] 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 Reviewed-by: Michael Adam (cherry picked from commit ee8fbbd41741e958e0ab6d7b9ab465d664abac60) --- buildtools/wafsamba/wafsamba.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index d8588bc..fafec1f 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -592,6 +592,7 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='', dep_vars = vars.keys() elif isinstance(vars, list): dep_vars = vars + dep_vars.append('ruledeps') bld.SET_BUILD_GROUP(group) t = bld( @@ -603,7 +604,7 @@ 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 always: -- 1.9.1 From d65b6141ef932c8b916e3efe5921de74dfb7deee Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Aug 2014 23:11:39 +0200 Subject: [PATCH 08/30] 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 Reviewed-by: Michael Adam (cherry picked from commit da8c76354549a64181cffc36e1c0bb0c6c4f87d3) --- buildtools/wafsamba/wafsamba.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index fafec1f..ff97e88 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -588,11 +588,8 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='', 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( @@ -607,6 +604,10 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='', dep_vars = dep_vars, name=name) + if vars is None: + vars = {} + t.env.SAMBA_GENERATOR_VARS = vars + if always: t.always = True -- 1.9.1 From 8216dfd319ba864d163089ed1e90efbae8aee714 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Aug 2014 23:11:39 +0200 Subject: [PATCH 09/30] 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 Reviewed-by: Michael Adam (cherry picked from commit 04bb8ff7e6a3908b952d4d95edc2c7411611ac33) --- buildtools/wafsamba/wafsamba.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index ff97e88..f58efea 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -578,6 +578,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''' @@ -587,7 +588,6 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='', if not enabled: return - dep_vars = [] dep_vars.append('ruledeps') dep_vars.append('SAMBA_GENERATOR_VARS') -- 1.9.1 From 47c6da7173320fb2987c1c1a0f39d55ec2850370 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Aug 2014 23:14:23 +0200 Subject: [PATCH 10/30] 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 Reviewed-by: Michael Adam (cherry picked from commit 7316653a82fea3dfe1ac8aa89003ce15836a11b9) --- buildtools/wafsamba/wafsamba.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index f58efea..3f47a50 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -739,12 +739,9 @@ def install_file(bld, destdir, file, chmod=MODE_644, flat=False, 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) - 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) -- 1.9.1 From a7dc222cef73a8892ed5aaa4be99fd5939bfef86 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Aug 2014 10:08:21 +0200 Subject: [PATCH 11/30] wafsamba: let SAMBA_BLDOPTIONS() use dep_vars=['defines'] instead of always=True Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam (cherry picked from commit a41a9ad0749755d612df81bb77384b4f479e1af2) --- buildtools/wafsamba/samba_patterns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py index 55ed540..62d988e 100644 --- a/buildtools/wafsamba/samba_patterns.py +++ b/buildtools/wafsamba/samba_patterns.py @@ -202,6 +202,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 -- 1.9.1 From 936bc515e1f30aff54458bafa7818db5822cc312 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Aug 2014 10:13:09 +0200 Subject: [PATCH 12/30] dynconfig/wscript: add dynconfig_varnames() Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam (cherry picked from commit 32ddd5b6559ad22b2ca84262c396dc889d661bab) --- dynconfig/wscript | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dynconfig/wscript b/dynconfig/wscript index a7cfa0a..1be6aaa 100755 --- a/dynconfig/wscript +++ b/dynconfig/wscript @@ -372,6 +372,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 = [] -- 1.9.1 From 18a8aa89916e0c13a52301220e87ef17a2e6f42a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Aug 2014 10:15:56 +0200 Subject: [PATCH 13/30] 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 Reviewed-by: Michael Adam (cherry picked from commit de0443ac7690923fa1731560fa51a551711f37fe) --- docs-xml/wscript_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build index 2c83a16..7af0f68 100644 --- a/docs-xml/wscript_build +++ b/docs-xml/wscript_build @@ -120,7 +120,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''' -- 1.9.1 From d92ca4d0b35ef3c6c9d71d9ea22ffe4effe16d2c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Aug 2014 10:29:50 +0200 Subject: [PATCH 14/30] 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 Reviewed-by: Michael Adam (cherry picked from commit bb9a939e78d54a4b09f38d1f7cec1544239fef34) --- lib/ldb/wscript | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ldb/wscript b/lib/ldb/wscript index a375675..fb32ecd 100755 --- a/lib/ldb/wscript +++ b/lib/ldb/wscript @@ -148,12 +148,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', -- 1.9.1 From 281ad8098164ee77786d7dda55705320768abab4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 25 Aug 2014 23:59:46 +0200 Subject: [PATCH 15/30] dynconfig: implement PERL_LIB_INSTALL_DIR. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Pair-Programmed-With: Stefan Metzmacher Signed-off-by: Michael Adam Signed-off-by: Stefan Metzmacher (cherry picked from commit e5d54c5841c003d55960458da29635b3656884df) --- dynconfig/wscript | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dynconfig/wscript b/dynconfig/wscript index 1be6aaa..1304bd3 100755 --- a/dynconfig/wscript +++ b/dynconfig/wscript @@ -111,6 +111,11 @@ dynconfig = { 'FHS-PATH': '${PYTHONARCHDIR}', 'OVERWRITE': True, }, + 'PERL_LIB_INSTALL_DIR' : { + 'STD-PATH': '${PERL_LIB_INSTALL_DIR}', + 'FHS-PATH': '${PERL_LIB_INSTALL_DIR}', + 'OVERWRITE': True, + }, 'INCLUDEDIR' : { 'STD-PATH': '${INCLUDEDIR}', 'FHS-PATH': '${INCLUDEDIR}/samba-4.0', -- 1.9.1 From bdd5aa05f751fda45ea11841d6860ad80e8d9d3b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Aug 2014 00:41:54 +0200 Subject: [PATCH 16/30] dynconfig: implement PERL_ARCH_INSTALL_DIR BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher (cherry picked from commit 6ad678166c85f0eb90b76ccf842d1aa8dcb6b41a) --- dynconfig/wscript | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dynconfig/wscript b/dynconfig/wscript index 1304bd3..6410c38 100755 --- a/dynconfig/wscript +++ b/dynconfig/wscript @@ -116,6 +116,11 @@ dynconfig = { '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', -- 1.9.1 From ddd81d81a4b9fe52ea2b131dc4234e9d36ffdb67 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Aug 2014 01:29:57 +0200 Subject: [PATCH 17/30] 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 Signed-off-by: Michael Adam Signed-off-by: Stefan Metzmacher (cherry picked from commit 75c3e240e0703be8c86596e689e466b4dee5e85e) --- buildtools/wafsamba/samba_perl.py | 62 +++++++++++++++++++++++++++++++++++++++ buildtools/wafsamba/wafsamba.py | 1 + 2 files changed, 63 insertions(+) create mode 100644 buildtools/wafsamba/samba_perl.py 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 = {} + +@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 3f47a50..032327b 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 * import samba_install -- 1.9.1 From e0bdc061215550f2f33c4406ccde4f83abdf52ce Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Aug 2014 01:31:17 +0200 Subject: [PATCH 18/30] 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 (cherry picked from commit 7bf9e937ae59e10a9b40be3a60ffaad49669fb83) --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index de245f5..f389f90 100644 --- a/wscript +++ b/wscript @@ -93,7 +93,7 @@ def configure(conf): 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)) -- 1.9.1 From f77a3eb40246af5693b224690cc37920207c82a2 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 4 Sep 2014 01:38:14 +0200 Subject: [PATCH 19/30] 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 Signed-off-by: Michael Adam Signed-off-by: Stefan Metzmacher (cherry picked from commit 191fc0e541e7c9d0a1095dc287402df9947ce779) --- pidl/wscript | 3 --- 1 file changed, 3 deletions(-) diff --git a/pidl/wscript b/pidl/wscript index 4965870..c4edf57 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) -- 1.9.1 From 4bf34832a89e40852e3a932eb3d48dddc4e83a87 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 27 Aug 2014 22:19:38 +0200 Subject: [PATCH 20/30] s3:build: don't detect perl in source3/wscript again. This is done in the top level now. Signed-off-by: Michael Adam (cherry picked from commit e7fc38a7df90e26a96ec5573042dccc1746e4f2c) --- source3/wscript | 1 - 1 file changed, 1 deletion(-) diff --git a/source3/wscript b/source3/wscript index bac3dd5..10aa232 100644 --- a/source3/wscript +++ b/source3/wscript @@ -565,7 +565,6 @@ msg.msg_acctrightslen = 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') -- 1.9.1 From 5cc41461894b4f51b55174dc07c5c6664b64638b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jul 2014 16:54:54 +0200 Subject: [PATCH 21/30] 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 Signed-off-by: Michael Adam Signed-off-by: Stefan Metzmacher (cherry picked from commit f73a0c2af9748d57721211472cd6c50b990ee693) --- buildtools/wafsamba/wafsamba.py | 47 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 032327b..c8220c2 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -725,9 +725,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: @@ -744,18 +773,28 @@ def install_file(bld, destdir, file, chmod=MODE_644, flat=False, 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) + file = inst_file if base_name: file = os.path.join(base_name, file) bld.install_as(dest, file, chmod=chmod) 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 -- 1.9.1 From 3f9400b648970a0d188561e741d8f0fcaf3d0c40 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 25 Aug 2014 23:57:23 +0200 Subject: [PATCH 22/30] 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 (cherry picked from commit b537c5a340bae2accbf35a4ec5eab7074b90f0b1) --- pidl/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pidl/wscript b/pidl/wscript index c4edf57..0d7626c 100644 --- a/pidl/wscript +++ b/pidl/wscript @@ -43,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') -- 1.9.1 From 2468ea4f13c48f699e2d71bba6851aa1d64d228a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 25 Aug 2014 23:58:48 +0200 Subject: [PATCH 23/30] pidl: remove superfluous "use lib ...". BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Michael Adam (cherry picked from commit fac24e11655c554cd3113dfb6fc918a0fd3c880c) --- pidl/pidl | 1 - 1 file changed, 1 deletion(-) 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 ); -- 1.9.1 From 24476954bde80c1f1149ff8f9284ea387e7eaf94 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 12 Nov 2014 11:44:39 +0100 Subject: [PATCH 24/30] Revert "script/autobuild: make use of --with-perl-{arch,lib}-install-dir" This reverts commit 7a6173ddce2142d3c0465908f2ced29aee7f32e8. --- script/autobuild.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index 315ba3f..29de197 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -212,9 +212,7 @@ 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) + self.cmd = self.cmd.replace("${PERL_VENDOR_LIB}", "--with-perl-vendorlib=%s/share/perl5" % self.prefix) # 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) -- 1.9.1 From a87599d93a43c0bcf13a0214fc6c3d122f7ca2f0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 12 Nov 2014 11:44:56 +0100 Subject: [PATCH 25/30] Revert "autobuild: Set perl vendorlib direcotry." This reverts commit fe7d930338f29aab47b55ead0a5323e1d9b31495. --- script/autobuild.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index 29de197..9d117c6 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -35,7 +35,7 @@ defaulttasks = [ "samba", "samba-ctdb", "samba-libs", "ldb", "tdb", "ntdb", "tal tasks = { # 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"), @@ -53,7 +53,7 @@ tasks = { ("ctdb-header-install", "cp ./ctdb/include/* ${PREFIX_DIR}/include", "text/plain"), ("ctdb-header-ls", "ls ${PREFIX_DIR}/include/ctdb.h", "text/plain"), - ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"), + ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"), ("make", "make", "text/plain"), ("check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"), ("install", "make install", "text/plain"), @@ -82,7 +82,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")], @@ -212,7 +212,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) - self.cmd = self.cmd.replace("${PERL_VENDOR_LIB}", "--with-perl-vendorlib=%s/share/perl5" % self.prefix) # 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) -- 1.9.1 From b26700b6d0f06e821560ce1669c24cbe92d82118 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Aug 2014 21:33:05 +0200 Subject: [PATCH 26/30] pidl/wscript: remove --with-perl-* options These are not needed anymore as we have useful defaults now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam (cherry picked from commit ee2148754e2e2604ac918343fa8769a25523eb49) --- pidl/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pidl/wscript b/pidl/wscript index 0d7626c..27cb230 100644 --- a/pidl/wscript +++ b/pidl/wscript @@ -26,7 +26,7 @@ def check_system_perl_module(conf, module, version=None): return True def set_options(opt): - opt.tool_options('perl') + return def configure(conf): # Check if perl(Parse::Yapp::Driver) is available. -- 1.9.1 From 02072e56513b273bf267aab76ba98df671c13f71 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 4 Sep 2014 12:45:21 +0200 Subject: [PATCH 27/30] Revert "wafsamba: Fail with error message if perl doesn't provide valid dirs." This reverts commit 2637890ef42a238093f0f3cbdda0d621d5f9b2e2. We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state. Everything special is now in buildtools/wafsamba/samba_perl.py. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher (cherry picked from commit c5dd2f18dd09b08758fc68a4aac10cf01d775c85) --- buildtools/wafadmin/Tools/perl.py | 58 +++++++++++++-------------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/buildtools/wafadmin/Tools/perl.py b/buildtools/wafadmin/Tools/perl.py index 0f34e79..e65ee5c 100644 --- a/buildtools/wafadmin/Tools/perl.py +++ b/buildtools/wafadmin/Tools/perl.py @@ -98,53 +98,33 @@ def check_perl_ext_devel(conf): conf.env.EXTUTILS_TYPEMAP = read_out('print "$Config{privlib}/ExtUtils/typemap"') conf.env.perlext_PATTERN = '%s.' + read_out('print $Config{dlext}')[0] - def try_any(keys): - for k in keys: - conf.start_msg("Checking for perl $Config{%s}:" % k) - try: - v = read_out('print $Config{%s}' % k)[0] - conf.end_msg("'%s'" % (v), 'GREEN') - return v - except IndexError: - conf.end_msg(False, 'YELLOW') - pass - return None - - perl_arch_install_dir = None - if getattr(Options.options, 'perl_arch_install_dir', None): - perl_arch_install_dir = Options.options.perl_arch_install_dir - if perl_arch_install_dir is None: - perl_arch_install_dir = try_any(['vendorarch', 'sitearch', 'archlib']) - if perl_arch_install_dir is None: - conf.fatal('No perl arch install directory autodetected.' + - 'Please define it with --with-perl-arch-install-dir.') - 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 getattr(Options.options, 'perl_lib_install_dir', None): - perl_lib_install_dir = Options.options.perl_lib_install_dir - if perl_lib_install_dir is None: - perl_lib_install_dir = try_any(['vendorlib', 'sitelib', 'privlib']) - if perl_lib_install_dir is None: - conf.fatal('No perl lib install directory autodetected. ' + - 'Please define it with --with-perl-lib-install-dir.') - 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 + if getattr(Options.options, 'perl_vendorarch_dir', None): + conf.env.PERL_VENDORARCH_DIR = Options.options.perl_vendorarch_dir + else: + try: + conf.env.PERL_VENDORARCH_DIR = read_out('print $Config{vendorarch}')[0] + except IndexError: + conf.env.PERL_VENDORARCH_DIR = "${DATADIR}/perl5" + + if getattr(Options.options, 'perl_vendorlib_dir', None): + conf.env.PERL_VENDORLIB_DIR = Options.options.perl_vendorlib_dir + else: + try: + conf.env.PERL_VENDORLIB_DIR = read_out('print $Config{vendorlib}')[0] + except IndexError: + conf.env.PERL_VENDORLIB_DIR = "${LIBDIR}/perl5" def set_options(opt): opt.add_option("--with-perl-binary", type="string", dest="perlbinary", help = 'Specify alternate perl binary', default=None) - opt.add_option("--with-perl-arch-install-dir", + opt.add_option("--with-perl-vendorarch", type="string", - dest="perl_arch_install_dir", + dest="perl_vendorarch_dir", help = ('Specify directory where to install arch specific files'), default=None) - opt.add_option("--with-perl-lib-install-dir", + opt.add_option("--with-perl-vendorlib", type="string", - dest="perl_lib_install_dir", + dest="perl_vendorlib_dir", help = ('Specify directory where to install vendor specific files'), default=None) -- 1.9.1 From 6ad7de54635b99c9040cdc78b712c9b2764b77e0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 4 Sep 2014 12:45:32 +0200 Subject: [PATCH 28/30] Revert "wafsamba: If perl can't provide defaults, define them." This reverts commit 0ba276ebad57d75a769e22414f94acbe8c177d97. We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state. Everything special is now in buildtools/wafsamba/samba_perl.py. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher (cherry picked from commit 42990ca3c8fa5752280840ea202a537915680b7d) --- buildtools/wafadmin/Tools/perl.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/buildtools/wafadmin/Tools/perl.py b/buildtools/wafadmin/Tools/perl.py index e65ee5c..8f13e28 100644 --- a/buildtools/wafadmin/Tools/perl.py +++ b/buildtools/wafadmin/Tools/perl.py @@ -101,18 +101,12 @@ def check_perl_ext_devel(conf): if getattr(Options.options, 'perl_vendorarch_dir', None): conf.env.PERL_VENDORARCH_DIR = Options.options.perl_vendorarch_dir else: - try: - conf.env.PERL_VENDORARCH_DIR = read_out('print $Config{vendorarch}')[0] - except IndexError: - conf.env.PERL_VENDORARCH_DIR = "${DATADIR}/perl5" + conf.env.PERL_VENDORARCH_DIR = read_out('print $Config{vendorarch}')[0] if getattr(Options.options, 'perl_vendorlib_dir', None): conf.env.PERL_VENDORLIB_DIR = Options.options.perl_vendorlib_dir else: - try: - conf.env.PERL_VENDORLIB_DIR = read_out('print $Config{vendorlib}')[0] - except IndexError: - conf.env.PERL_VENDORLIB_DIR = "${LIBDIR}/perl5" + conf.env.PERL_VENDORLIB_DIR = read_out('print $Config{vendorlib}')[0] def set_options(opt): opt.add_option("--with-perl-binary", type="string", dest="perlbinary", help = 'Specify alternate perl binary', default=None) -- 1.9.1 From a27d80ba2d18611df607b4e9519224b20f8db3f2 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 4 Sep 2014 12:45:40 +0200 Subject: [PATCH 29/30] Revert "buildtools: Add perl vendorlib configure option." This reverts commit 48f0183dbeddd7bdf333a40fe0d3e1c7e7fe00f2. We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state. Everything special is now in buildtools/wafsamba/samba_perl.py. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher (cherry picked from commit 0b91f7d806b9d18881edb8df981a9eeb057580e5) --- buildtools/wafadmin/Tools/perl.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/buildtools/wafadmin/Tools/perl.py b/buildtools/wafadmin/Tools/perl.py index 8f13e28..99e0540 100644 --- a/buildtools/wafadmin/Tools/perl.py +++ b/buildtools/wafadmin/Tools/perl.py @@ -103,11 +103,6 @@ def check_perl_ext_devel(conf): else: conf.env.PERL_VENDORARCH_DIR = read_out('print $Config{vendorarch}')[0] - if getattr(Options.options, 'perl_vendorlib_dir', None): - conf.env.PERL_VENDORLIB_DIR = Options.options.perl_vendorlib_dir - else: - conf.env.PERL_VENDORLIB_DIR = read_out('print $Config{vendorlib}')[0] - def set_options(opt): opt.add_option("--with-perl-binary", type="string", dest="perlbinary", help = 'Specify alternate perl binary', default=None) @@ -117,8 +112,3 @@ def set_options(opt): help = ('Specify directory where to install arch specific files'), default=None) - opt.add_option("--with-perl-vendorlib", - type="string", - dest="perl_vendorlib_dir", - help = ('Specify directory where to install vendor specific files'), - default=None) -- 1.9.1 From 56994a077908f555d65b8578396a6aae0ba97168 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 4 Sep 2014 12:45:48 +0200 Subject: [PATCH 30/30] Revert "buildtools: Rename perl vendorarch configure option." This reverts commit 04685ff4eed9535769d6a5feee7353f1796a4389. We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state. Everything special is now in buildtools/wafsamba/samba_perl.py. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472 Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Tue Sep 9 03:07:20 CEST 2014 on sn-devel-104 (cherry picked from commit 1f878b9986523ce9e35dd74ae3c201f4e55f66f3) --- buildtools/wafadmin/Tools/perl.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/buildtools/wafadmin/Tools/perl.py b/buildtools/wafadmin/Tools/perl.py index 99e0540..a6787a8 100644 --- a/buildtools/wafadmin/Tools/perl.py +++ b/buildtools/wafadmin/Tools/perl.py @@ -98,17 +98,12 @@ def check_perl_ext_devel(conf): conf.env.EXTUTILS_TYPEMAP = read_out('print "$Config{privlib}/ExtUtils/typemap"') conf.env.perlext_PATTERN = '%s.' + read_out('print $Config{dlext}')[0] - if getattr(Options.options, 'perl_vendorarch_dir', None): - conf.env.PERL_VENDORARCH_DIR = Options.options.perl_vendorarch_dir + if getattr(Options.options, 'perlarchdir', None): + conf.env.ARCHDIR_PERL = Options.options.perlarchdir else: - conf.env.PERL_VENDORARCH_DIR = read_out('print $Config{vendorarch}')[0] + conf.env.ARCHDIR_PERL = read_out('print $Config{sitearch}')[0] def set_options(opt): opt.add_option("--with-perl-binary", type="string", dest="perlbinary", help = 'Specify alternate perl binary', default=None) - - opt.add_option("--with-perl-vendorarch", - type="string", - dest="perl_vendorarch_dir", - help = ('Specify directory where to install arch specific files'), - default=None) + opt.add_option("--with-perl-archdir", type="string", dest="perlarchdir", help = 'Specify directory where to install arch specific files', default=None) -- 1.9.1