wafsamba: Fix building of modules as shared libraries.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 14 Jun 2010 23:24:20 +0000 (01:24 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 15 Jun 2010 11:15:50 +0000 (13:15 +0200)
buildtools/wafsamba/wafsamba.py
source4/smbd/wscript_build

index 183253665e24a8910e711c0ea9b98915fd08c045..faa5358f3796edd64c620ba3e3b13f271c2168f0 100644 (file)
@@ -5,6 +5,7 @@ import Build, os, Options, Task, Utils, cc, TaskGen, fnmatch, re, shutil, Logs,
 from Configure import conf
 from Logs import debug
 from samba_utils import SUBST_VARS_RECURSIVE
+TaskGen.task_gen.apply_verif = Utils.nada
 
 # bring in the other samba modules
 from samba_optimisation import *
@@ -327,16 +328,23 @@ def SAMBA_MODULE(bld, modname, source,
                  enabled=True):
     '''define a Samba module.'''
 
+    source = bld.EXPAND_VARIABLES(source, vars=vars)
+
+    obj_target = modname + '.objlist'
+
+    bld.SAMBA_SUBSYSTEM(obj_target, source,
+                    deps=deps,
+                    includes=includes,
+                    autoproto=autoproto,
+                    autoproto_extra_source=autoproto_extra_source,
+                    cflags=cflags,
+                    local_include=local_include,
+                    enabled=enabled)
+
     if internal_module or BUILTIN_LIBRARY(bld, modname):
         # treat internal modules as subsystems for now
-        SAMBA_SUBSYSTEM(bld, modname, source,
-                        deps=deps,
-                        includes=includes,
-                        autoproto=autoproto,
-                        autoproto_extra_source=autoproto_extra_source,
-                        cflags=cflags,
-                        local_include=local_include,
-                        enabled=enabled)
+        bld.SAMBA_SUBSYSTEM(modname, deps=obj_target, source=[],
+                            enabled=enabled)
         bld.ADD_INIT_FUNCTION(subsystem, modname, init_function)
         return
 
@@ -344,39 +352,31 @@ def SAMBA_MODULE(bld, modname, source,
         SET_TARGET_TYPE(bld, modname, 'DISABLED')
         return
 
-    source = bld.EXPAND_VARIABLES(source, vars=vars)
-    source = unique_list(TO_LIST(source))
-
-    # remember empty modules, so we can strip the dependencies
-    if ((source == '') or (source == [])) and deps == '' and public_deps == '':
-        SET_TARGET_TYPE(bld, modname, 'EMPTY')
-        return
-
     if not SET_TARGET_TYPE(bld, modname, 'MODULE'):
         return
 
+    deps = TO_LIST(deps)
+    deps.append(obj_target)
     if subsystem is not None:
-        deps += ' ' + subsystem
+        deps.append(subsystem)
 
     bld.SET_BUILD_GROUP('main')
     t = bld(
         features       = 'cc cshlib install_lib',
-        source         = source,
+        source         = [],
         target         = modname,
         samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags),
         samba_includes = includes,
         local_include  = local_include,
-        samba_deps     = TO_LIST(deps),
+        samba_deps     = deps,
         install_path   = None,
         samba_inst_path= "${MODULESDIR}/%s" % subsystem,
         samba_realname = None,
         vnum           = None,
         samba_install  = True,
+        is_bundled     = False,
         )
 
-    if autoproto is not None:
-        bld.SAMBA_AUTOPROTO(autoproto, source + TO_LIST(autoproto_extra_source))
-
 Build.BuildContext.SAMBA_MODULE = SAMBA_MODULE
 
 
index 131741153ca7d9546e7766c8f8556ab57f51bc12..68e75ca1da25e6b6fe9a87d63f3a754479f3f709 100644 (file)
@@ -47,7 +47,7 @@ bld.SAMBA_MODULE('process_model_thread',
        source='process_thread.c',
        subsystem='process_model',
        init_function='process_model_thread_init',
-        enabled=False,
+       enabled=False,
        deps='pthread'
        )