+def HEIMDAL_BINARY(bld, binname, source,
+ deps='',
+ includes='',
+ ldflags=None,
+ cflags='',
+ use_hostcc=False,
+ use_global_deps=True,
+ compiler=None,
+ group='binaries',
+ local_include=True,
+ install=True,
+ install_path=None,
+ enabled=True):
+ '''define a Samba binary'''
+
+ if not SET_TARGET_TYPE(bld, binname, 'BINARY'):
+ return
+
+ features = 'cc cprogram symlink_bin install_bin'
+
+ obj_target = binname + '.objlist'
+
+ # first create a target for building the object files for this binary
+ # by separating in this way, we avoid recompiling the C files
+ # separately for the install binary and the build binary
+ bld.SAMBA_SUBSYSTEM(obj_target,
+ source = source,
+ deps = deps,
+ includes = includes,
+ cflags = cflags,
+ group = group,
+ local_include = local_include,
+ use_hostcc = use_hostcc,
+ use_global_deps= use_global_deps)
+
+ bld.SET_BUILD_GROUP(group)
+
+ # the binary itself will depend on that object target
+ deps = TO_LIST(deps)
+ deps.append(obj_target)
+
+ t = bld(
+ features = features,
+ source = [],
+ target = binname,
+ samba_cflags = CURRENT_CFLAGS(bld, binname, cflags),
+ samba_deps = deps,
+ samba_includes = includes,
+ local_include = local_include,
+ top = True,
+ install_path = None,
+ samba_install = install
+ )
+
+Build.BuildContext.HEIMDAL_BINARY = HEIMDAL_BINARY
+
+