heimdal_build: Recurse to bld.SAMBA_BINARY()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 4 Nov 2019 01:42:24 +0000 (14:42 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 13 Nov 2019 08:42:30 +0000 (08:42 +0000)
This reduces a little of the duplication added when it was thought
that having a distinct waf wrapper on heimdal might allow this to be
ported upstream.

It will also streamline building a dedicated fuzzing mode in Samba.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
buildtools/wafsamba/wafsamba.py
source4/heimdal_build/wscript_build

index 48e564934898a8b2892cdde7b190d19661205eb3..7081f382eaaf64c9054296663f8c3fa69090a2e4 100644 (file)
@@ -354,6 +354,7 @@ def SAMBA_BINARY(bld, binname, source,
                  local_include=True,
                  global_include=True,
                  subsystem_name=None,
+                 allow_warnings=False,
                  pyembed=False,
                  vars=None,
                  subdir=None,
@@ -382,6 +383,8 @@ def SAMBA_BINARY(bld, binname, source,
 
     if group == 'binaries':
         subsystem_group = 'main'
+    elif group == 'build_compilers':
+        subsystem_group = 'compiler_libraries'
     else:
         subsystem_group = group
 
@@ -410,6 +413,7 @@ def SAMBA_BINARY(bld, binname, source,
                         global_include = global_include,
                         use_hostcc     = use_hostcc,
                         pyext          = pyembed,
+                        allow_warnings = allow_warnings,
                         use_global_deps= use_global_deps)
 
     bld.SET_BUILD_GROUP(group)
index 163b622fca946863699fe40b674ac61a53a2af32..c9a974ca0fb860e741c0229477ce351ad46ce3a5 100644 (file)
@@ -314,47 +314,19 @@ def HEIMDAL_BINARY(binname, source,
                  install_path=None):
     '''define a Samba binary'''
 
-    if not SET_TARGET_TYPE(bld, binname, 'BINARY'):
-        return
-
-    features = 'c cprogram symlink_bin install_bin'
-
-    obj_target = binname + '.objlist'
-
-    if group == 'build_compilers':
-        subsystem_group = 'compiler_libraries'
-    else:
-        subsystem_group = group
-
-    # 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
-    HEIMDAL_SUBSYSTEM(obj_target,
-                      source         = source,
-                      deps           = deps,
-                      includes       = includes,
-                      cflags         = cflags,
-                      group          = subsystem_group,
-                      use_hostcc     = use_hostcc,
-                      use_global_deps= use_global_deps)
-
-    bld.set_group(group)
-
-    # the binary itself will depend on that object target
-    deps = to_list(deps)
-    deps.append(obj_target)
+    source = heimdal_paths(source)
 
-    t = bld(
-        features       = features,
-        source         = [],
-        target         = binname,
-        samba_deps     = deps,
-        samba_includes = includes,
-        local_include  = True,
-        top            = True,
-        install_path   = None,
-        samba_install  = install
-        )
+    bld.SAMBA_BINARY(binname,
+                     source         = source,
+                     deps           = deps,
+                     includes       = includes,
+                     cflags         = cflags,
+                     group          = group,
+                     use_hostcc     = use_hostcc,
+                     use_global_deps= use_global_deps,
+                     install_path   = None,
+                     install        = install,
+                     allow_warnings = True)
 
 
 if not bld.CONFIG_SET('USING_SYSTEM_ROKEN'):