s4-waf: re-use SAMBA_LIBRARY() in building shared modules
authorAndrew Tridgell <tridge@samba.org>
Wed, 18 Aug 2010 23:22:54 +0000 (09:22 +1000)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 22 Aug 2010 14:35:30 +0000 (16:35 +0200)
make SAMBA_MODULE() call SAMBA_LIBRARY() to do the heavy lifting. This
fixes the problem with modules being a bit too slim :-)

Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>

buildtools/wafsamba/wafsamba.py

index 21ed001372bbf40f510d73aa085e1908011608ba..c24d82b930be56a71e5afa4305782cea042d9b69 100644 (file)
@@ -349,50 +349,30 @@ def SAMBA_MODULE(bld, modname, source,
         SET_TARGET_TYPE(bld, modname, 'DISABLED')
         return
 
-    if not SET_TARGET_TYPE(bld, modname, 'MODULE'):
-        return
-
     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)
-
-    deps = TO_LIST(deps)
-    deps.append(obj_target)
     realname = modname 
     if subsystem is not None:
-        deps.append(subsystem)
+        deps += ' ' + subsystem
         while realname.startswith("lib"+subsystem+"_"):
             realname = realname[len("lib"+subsystem+"_"):]
         while realname.startswith(subsystem+"_"):
             realname = realname[len(subsystem+"_"):]
-        while realname.startswith("lib"):
-            realname = realname[len("lib"):]
 
-    bld.SET_BUILD_GROUP('main')
-    t = bld(
-        features       = 'cc cshlib install_lib',
-        source         = [],
-        target         = realname,
-        name           = modname,
-        link_name      = "modules/%s/%s.${SHLIBEXT}" % (subsystem, realname),
-        samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags),
-        samba_includes = includes,
-        local_include  = local_include,
-        samba_deps     = deps,
-        install_path   = None,
-        samba_inst_path= "${MODULESDIR}/%s" % subsystem,
-        samba_realname = realname+ ".${SHLIBEXT}",
-        vnum           = None,
-        samba_install  = True,
-        is_bundled     = False,
-        )
+    realname = bld.env.shlib_PATTERN % realname
+    while realname.startswith("lib"):
+        realname = realname[len("lib"):]
+
+    bld.SAMBA_LIBRARY(modname,
+                      source,
+                      deps=deps,
+                      cflags=cflags,
+                      realname = realname,
+                      autoproto = autoproto,
+                      local_include=local_include,
+                      vars=vars,
+                      install_path="${MODULESDIR}/%s" % subsystem
+                      )
 
 Build.BuildContext.SAMBA_MODULE = SAMBA_MODULE