import stale_files
import symbols
import pkgconfig
+import configure_file
# some systems have broken threading in python
if os.environ.get('WAF_NOTHREADS') == '1':
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
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)
ldflags = TO_LIST(ldflags)
features = 'cc cshlib symlink_lib install_lib'
- if target_type == 'PYTHON':
+ if pyext:
features += ' pyext'
- if pyext or pyembed:
- # this is quite strange. we should add pyext feature for pyext
- # but that breaks the build. This may be a bug in the waf python tool
+ if pyembed:
features += ' pyembed'
if abi_directory:
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
)
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
subdir=None,
enabled=True,
pyembed=False,
+ manpages=None,
allow_undefined_symbols=False
):
'''define a Samba module.'''
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,
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
link_name=build_link_name,
install_path="${MODULESDIR}/%s" % subsystem,
pyembed=pyembed,
+ manpages=manpages,
allow_undefined_symbols=allow_undefined_symbols
)
cflags='',
cflags_end=None,
group='main',
- init_function_sentinal=None,
+ init_function_sentinel=None,
autoproto=None,
autoproto_extra_source='',
depends_on='',
vars=None,
subdir=None,
hide_symbols=False,
- pyext=False):
+ pyext=False,
+ pyembed=False):
'''define a Samba subsystem'''
if not enabled:
features = 'cc'
if pyext:
features += ' pyext'
+ if pyembed:
+ features += ' pyembed'
t = bld(
features = features,
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:
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,
before='cc',
ext_out='.c',
samba_type='GENERATOR',
- dep_vars = [rule] + (vars or []),
+ dep_vars = [rule] + dep_vars,
name=name)
if always:
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))
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():
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