X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=buildtools%2Fwafsamba%2Fwafsamba.py;h=dcbb04704a75e979aa8203755afbdf1be9aeab5c;hb=d61d2af3727a19cc4ddc88ec2faa8aafff9c7422;hp=0a120da0d27f7ed562d907bc9b48e9e06b157170;hpb=312fd94002cd576140e5d90ef70ea2dd053c949a;p=samba.git diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 0a120da0d27..dcbb04704a7 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -31,6 +31,7 @@ import samba_wildcard import stale_files import symbols import pkgconfig +import configure_file # some systems have broken threading in python if os.environ.get('WAF_NOTHREADS') == '1': @@ -132,6 +133,9 @@ def SAMBA_LIBRARY(bld, libname, source, enabled=True): '''define a Samba library''' + if LIB_MUST_BE_PRIVATE(bld, libname): + private_library=True + if not enabled: SET_TARGET_TYPE(bld, libname, 'DISABLED') return @@ -172,7 +176,8 @@ def SAMBA_LIBRARY(bld, libname, source, autoproto_extra_source=autoproto_extra_source, depends_on = depends_on, hide_symbols = hide_symbols, - pyext = pyext or (target_type == "PYTHON"), + pyembed = pyembed, + pyext = pyext, local_include = local_include, global_include = global_include) @@ -211,9 +216,8 @@ def SAMBA_LIBRARY(bld, libname, source, ldflags = TO_LIST(ldflags) features = 'cc cshlib symlink_lib install_lib' - if target_type == 'PYTHON': + if pyext: features += ' pyext' - allow_undefined_symbols = True if pyembed: features += ' pyembed' @@ -281,9 +285,9 @@ def SAMBA_LIBRARY(bld, libname, source, if pc_files is not None and not private_library: bld.PKG_CONFIG_FILES(pc_files, vnum=vnum) - if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and + if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']): - bld.MANPAGES(manpages) + bld.MANPAGES(manpages, install) Build.BuildContext.SAMBA_LIBRARY = SAMBA_LIBRARY @@ -379,7 +383,7 @@ def SAMBA_BINARY(bld, binname, source, ) if manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']: - bld.MANPAGES(manpages) + bld.MANPAGES(manpages, install) Build.BuildContext.SAMBA_BINARY = SAMBA_BINARY @@ -390,7 +394,7 @@ def SAMBA_MODULE(bld, modname, source, includes='', subsystem=None, init_function=None, - module_init_name='samba_module_init', + module_init_name='samba_init_module', autoproto=None, autoproto_extra_source='', cflags='', @@ -401,6 +405,7 @@ def SAMBA_MODULE(bld, modname, source, subdir=None, enabled=True, pyembed=False, + manpages=None, allow_undefined_symbols=False ): '''define a Samba module.''' @@ -410,6 +415,9 @@ def SAMBA_MODULE(bld, modname, source, source = bld.SUBDIR(subdir, source) if internal_module or BUILTIN_LIBRARY(bld, modname): + # Do not create modules for disabled subsystems + if subsystem and GET_TARGET_TYPE(bld, subsystem) == 'DISABLED': + return bld.SAMBA_SUBSYSTEM(modname, source, deps=deps, includes=includes, @@ -427,6 +435,10 @@ def SAMBA_MODULE(bld, modname, source, SET_TARGET_TYPE(bld, modname, 'DISABLED') return + # Do not create modules for disabled subsystems + if subsystem and GET_TARGET_TYPE(bld, subsystem) == 'DISABLED': + return + obj_target = modname + '.objlist' realname = modname @@ -459,6 +471,7 @@ def SAMBA_MODULE(bld, modname, source, link_name=build_link_name, install_path="${MODULESDIR}/%s" % subsystem, pyembed=pyembed, + manpages=manpages, allow_undefined_symbols=allow_undefined_symbols ) @@ -477,7 +490,7 @@ def SAMBA_SUBSYSTEM(bld, modname, source, cflags='', cflags_end=None, group='main', - init_function_sentinal=None, + init_function_sentinel=None, autoproto=None, autoproto_extra_source='', depends_on='', @@ -491,7 +504,8 @@ def SAMBA_SUBSYSTEM(bld, modname, source, vars=None, subdir=None, hide_symbols=False, - pyext=False): + pyext=False, + pyembed=False): '''define a Samba subsystem''' if not enabled: @@ -518,6 +532,8 @@ def SAMBA_SUBSYSTEM(bld, modname, source, features = 'cc' if pyext: features += ' pyext' + if pyembed: + features += ' pyembed' t = bld( features = features, @@ -532,7 +548,7 @@ def SAMBA_SUBSYSTEM(bld, modname, source, global_include = global_include, samba_subsystem= subsystem_name, samba_use_hostcc = use_hostcc, - samba_use_global_deps = use_global_deps + samba_use_global_deps = use_global_deps, ) if cflags_end is not None: @@ -564,6 +580,12 @@ 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 + bld.SET_BUILD_GROUP(group) t = bld( rule=rule, @@ -574,7 +596,7 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='', before='cc', ext_out='.c', samba_type='GENERATOR', - dep_vars = [rule] + (vars or []), + dep_vars = [rule] + dep_vars, name=name) if always: @@ -648,7 +670,7 @@ def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None): bld.SET_BUILD_GROUP('build_source') for s in TO_LIST(source): iname = s - if installname != None: + if installname is not None: iname = installname target = os.path.join(installdir, iname) tgtdir = os.path.dirname(os.path.join(bld.srcnode.abspath(bld.env), '..', target)) @@ -749,7 +771,7 @@ def INSTALL_DIRS(bld, destdir, dirs): Build.BuildContext.INSTALL_DIRS = INSTALL_DIRS -def MANPAGES(bld, manpages): +def MANPAGES(bld, manpages, install): '''build and install manual pages''' bld.env.MAN_XSL = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' for m in manpages.split(): @@ -758,11 +780,31 @@ def MANPAGES(bld, manpages): source=source, target=m, group='final', - rule='${XSLTPROC} -o ${TGT} --nonet ${MAN_XSL} ${SRC}' + rule='${XSLTPROC} --xinclude -o ${TGT} --nonet ${MAN_XSL} ${SRC}' ) - bld.INSTALL_FILES('${MANDIR}/man%s' % m[-1], m, flat=True) + if install: + bld.INSTALL_FILES('${MANDIR}/man%s' % m[-1], m, flat=True) Build.BuildContext.MANPAGES = MANPAGES +def SAMBAMANPAGES(bld, manpages): + '''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' + bld.env.SAMBA_CATALOGS = 'file:///etc/xml/catalog file:///usr/local/share/xml/catalog file://' + bld.srcnode.abspath() + '/bin/default/docs-xml/build/catalog.xml' + + for m in manpages.split(): + source = m + '.xml' + 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} --nonet -o ${TGT} ${SAMBA_MAN_XSL} ${TGT}.xml''' + ) + bld.INSTALL_FILES('${MANDIR}/man%s' % m[-1], m, flat=True) +Build.BuildContext.SAMBAMANPAGES = SAMBAMANPAGES ############################################################# # give a nicer display when building different types of files