waf: Support aliases in SAMBA_MODULE.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 4 Sep 2010 01:42:37 +0000 (03:42 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 4 Sep 2010 13:00:32 +0000 (15:00 +0200)
buildtools/wafsamba/wafsamba.py

index 43c56281392db999ae82f841d5a9d6e9d2393c4e..80a6f714170f45d4300d9885d103c5e37abcf1b3 100644 (file)
@@ -349,33 +349,35 @@ def SAMBA_MODULE(bld, modname, source,
         SET_TARGET_TYPE(bld, modname, 'DISABLED')
         return
 
-    obj_target = modname + '.objlist'
-
-    realname = modname
-    if subsystem is not None:
-        deps += ' ' + subsystem
-        while realname.startswith("lib"+subsystem+"_"):
-            realname = realname[len("lib"+subsystem+"_"):]
-        while realname.startswith(subsystem+"_"):
-            realname = realname[len(subsystem+"_"):]
-
-    realname = bld.env.shlib_PATTERN % realname
-    while realname.startswith("lib"):
-        realname = realname[len("lib"):]
-
-    build_link_name = "modules/%s/%s" % (subsystem, realname)
-
-    bld.SAMBA_LIBRARY(modname,
-                      source,
-                      deps=deps,
-                      cflags=cflags,
-                      realname = realname,
-                      autoproto = autoproto,
-                      local_include=local_include,
-                      vars=vars,
-                      link_name=build_link_name,
-                      install_path="${MODULESDIR}/%s" % subsystem
-                      )
+    modnames = [modname] + TO_LIST(aliases)
+    for modname in modnames:
+        obj_target = modname + '.objlist'
+
+        realname = modname
+        if subsystem is not None:
+            deps += ' ' + subsystem
+            while realname.startswith("lib"+subsystem+"_"):
+                realname = realname[len("lib"+subsystem+"_"):]
+            while realname.startswith(subsystem+"_"):
+                realname = realname[len(subsystem+"_"):]
+
+        realname = bld.env.shlib_PATTERN % realname
+        while realname.startswith("lib"):
+            realname = realname[len("lib"):]
+
+        build_link_name = "modules/%s/%s" % (subsystem, realname)
+
+        bld.SAMBA_LIBRARY(modname,
+                          source,
+                          deps=deps,
+                          cflags=cflags,
+                          realname = realname,
+                          autoproto = autoproto,
+                          local_include=local_include,
+                          vars=vars,
+                          link_name=build_link_name,
+                          install_path="${MODULESDIR}/%s" % subsystem
+                          )
 
 Build.BuildContext.SAMBA_MODULE = SAMBA_MODULE