source3/wscript: support 'pdb_ldap' module in configure
authorAlexander Bokovoy <ab@samba.org>
Wed, 6 Feb 2013 08:43:16 +0000 (10:43 +0200)
committerAlexander Bokovoy <ab@samba.org>
Wed, 6 Feb 2013 10:51:11 +0000 (11:51 +0100)
While PASSDB module ldapsam is called pdb_ldapsam internally,
support specifying 'pdb_ldap' during configure step.

This should make transition to pdb_ldapsam transparent to distributions.

Reviewed-by: Andreas Schneider <asn@samba.org>
source3/wscript

index d223316a3b03e5bd86c8b0415fca689eece63998..84abf76a3d9ac6618ee4edf15f352dd6bab841bf 100644 (file)
@@ -1741,6 +1741,19 @@ main() {
     explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',')
     explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',')
 
+    def replace_list_item(lst, item, value):
+        try:
+            idx = lst.index(item)
+            lst[idx] = value
+        except:
+            pass
+    # PDB module file name should have the same name as module registers itself
+    # In Autoconf build we export LDAP passdb module as ldapsam but WAF build
+    # was always exporting pdb_ldap. In order to support existing packages
+    # allow referring to pdb_ldapsam as pdb_ldap but use proper name internally.
+    replace_list_item(explicit_shared_modules, 'pdb_ldap', 'pdb_ldapsam')
+    replace_list_item(explicit_static_modules, 'pdb_ldap', 'pdb_ldapsam')
+
     final_static_modules = default_static_modules
     final_shared_modules = default_shared_modules