[PATCHSET] tidy up winbind/idmap build

Michael Adam obnox at samba.org
Mon Sep 23 04:37:07 CEST 2013


Hi,

attached find a patchset that tidies up source3/winbindd/wscript_build a bit:

- It removes the variables for source file (collections) and places
  the source file lists directly in the subsystem/module/library
  definitions.
- It introduces subsystems for IDMAP_RW and IDMAP_TDB_COMMON to
  fix the dependencies there.
- It gets rid of all occurrences of "vars=locals()" in this
  wscript_build.

Please review/comment/push as appropriate.

A heads up regarding more to come:

This patchset is in preparation of a bigger patchset touching
idmap_autorid (and extending "net idmap" with several functions
for manipulating the idmap autorid database).

This patchset has also started me to look into cleaning up
more of the source3 build. I will follow up soon..

Cheers - Michael

-------------- next part --------------
From 416c29d07e0560f8081e574c9fddd9f17ba88c59 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sun, 22 Sep 2013 22:49:22 +0200
Subject: [PATCH 1/6] build: reorganize idmap_rw and idmap_tdb int subsystems
 with proper dependencies

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/winbindd/wscript_build |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index aacd859..7b5dc97 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -14,16 +14,22 @@ IDMAP_HASH_SRC = '''idmap_hash/idmap_hash.c
 
 IDMAP_AUTORID_SRC = '''idmap_autorid.c'''
 
-IDMAP_RW_SRC = 'idmap_rw.c'
-IDMAP_SRC = 'idmap.c idmap_util.c idmap_tdb_common.c ${IDMAP_RW_SRC}'
+IDMAP_SRC = 'idmap.c idmap_util.c'
 
 bld.SAMBA3_LIBRARY('idmap',
                    source=IDMAP_SRC,
                    deps='samba-util',
-                   vars=locals(),
                    allow_undefined_symbols=True,
                    private_library=True)
 
+bld.SAMBA3_SUBSYSTEM('IDMAP_RW',
+                     source='idmap_rw.c',
+                     deps='samba-util')
+
+bld.SAMBA3_SUBSYSTEM('IDMAP_TDB_COMMON',
+                     source='idmap_tdb_common.c',
+                     deps='tdb IDMAP_RW')
+
 bld.SAMBA3_SUBSYSTEM('IDMAP_HASH',
                     source=IDMAP_HASH_SRC,
                     deps='samba-util krb5samba',
@@ -72,7 +78,7 @@ bld.SAMBA3_MODULE('idmap_passdb',
 bld.SAMBA3_MODULE('idmap_ldap',
                  subsystem='idmap',
                  source=IDMAP_LDAP_SRC,
-                 deps='smbldap smbldaphelper pdb',
+                 deps='smbldap smbldaphelper pdb IDMAP_RW',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ldap'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ldap') and bld.CONFIG_SET("HAVE_LDAP"),
@@ -89,7 +95,7 @@ bld.SAMBA3_MODULE('idmap_nss',
 bld.SAMBA3_MODULE('idmap_tdb',
                  subsystem='idmap',
                  source=IDMAP_TDB_SRC,
-                 deps='samba-util tdb',
+                 deps='samba-util tdb IDMAP_TDB_COMMON',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_tdb'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_tdb'))
@@ -97,7 +103,7 @@ bld.SAMBA3_MODULE('idmap_tdb',
 bld.SAMBA3_MODULE('idmap_tdb2',
                  subsystem='idmap',
                  source=IDMAP_TDB2_SRC,
-                 deps='samba-util tdb',
+                 deps='samba-util tdb IDMAP_TDB_COMMON',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_tdb2'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_tdb2'))
@@ -114,7 +120,7 @@ bld.SAMBA3_MODULE('idmap_hash',
 bld.SAMBA3_MODULE('idmap_autorid',
                  subsystem='idmap',
                  source=IDMAP_AUTORID_SRC,
-                 deps='samba-util tdb',
+                 deps='samba-util tdb IDMAP_TDB_COMMON',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_autorid'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_autorid'),
-- 
1.7.9.5


From d308336c97834119b32ea1a13dbb78ed0fb62245 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sun, 22 Sep 2013 22:51:48 +0200
Subject: [PATCH 2/6] build: remove vars=locals() from the IDMAP_AD subsystem:
 there is no need for this

Might have been a copy'n'paste.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/winbindd/wscript_build |    1 -
 1 file changed, 1 deletion(-)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 7b5dc97..738d42f 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -38,7 +38,6 @@ bld.SAMBA3_SUBSYSTEM('IDMAP_HASH',
 bld.SAMBA3_SUBSYSTEM('IDMAP_AD',
                     source=IDMAP_AD_SRC,
                     deps='ads nss_info',
-                    vars=locals(),
                     enabled=bld.CONFIG_SET("HAVE_LDAP"))
 
 bld.SAMBA3_MODULE('idmap_ad',
-- 
1.7.9.5


From 1b3fc2b4160088c04f99cf7c605ec17ca7077a0c Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sun, 22 Sep 2013 23:03:10 +0200
Subject: [PATCH 3/6] build: clean the idmap sybsystems/modules definitions

Directly list the sources in the definitions of subsystems/modules/libraries

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/winbindd/wscript_build |   46 ++++++++++++----------------------------
 1 file changed, 13 insertions(+), 33 deletions(-)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 738d42f..b1aa65e 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -1,23 +1,7 @@
 #!/usr/bin/env python
 
-IDMAP_AD_SRC = '''idmap_ad.c'''
-IDMAP_RFC2307_SRC = '''idmap_rfc2307.c'''
-IDMAP_RID_SRC = '''idmap_rid.c'''
-IDMAP_PASSDB_SRC = '''idmap_passdb.c'''
-IDMAP_LDAP_SRC = '''idmap_ldap.c'''
-IDMAP_NSS_SRC = '''idmap_nss.c'''
-IDMAP_TDB_SRC = '''idmap_tdb.c'''
-IDMAP_TDB2_SRC = '''idmap_tdb2.c'''
-
-IDMAP_HASH_SRC = '''idmap_hash/idmap_hash.c
-                    idmap_hash/mapfile.c'''
-
-IDMAP_AUTORID_SRC = '''idmap_autorid.c'''
-
-IDMAP_SRC = 'idmap.c idmap_util.c'
-
 bld.SAMBA3_LIBRARY('idmap',
-                   source=IDMAP_SRC,
+                   source='idmap.c idmap_util.c',
                    deps='samba-util',
                    allow_undefined_symbols=True,
                    private_library=True)
@@ -31,12 +15,12 @@ bld.SAMBA3_SUBSYSTEM('IDMAP_TDB_COMMON',
                      deps='tdb IDMAP_RW')
 
 bld.SAMBA3_SUBSYSTEM('IDMAP_HASH',
-                    source=IDMAP_HASH_SRC,
+                    source='idmap_hash/idmap_hash.c idmap_hash/mapfile.c',
                     deps='samba-util krb5samba',
                     vars=locals())
 
 bld.SAMBA3_SUBSYSTEM('IDMAP_AD',
-                    source=IDMAP_AD_SRC,
+                    source='idmap_ad.c',
                     deps='ads nss_info',
                     enabled=bld.CONFIG_SET("HAVE_LDAP"))
 
@@ -52,7 +36,7 @@ bld.SAMBA3_MODULE('idmap_ad',
 bld.SAMBA3_MODULE('idmap_rfc2307',
                  subsystem='idmap',
                  allow_undefined_symbols=True,
-                 source=IDMAP_RFC2307_SRC,
+                 source='idmap_rfc2307.c',
                  init_function='',
                  deps='ads',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_rfc2307'),
@@ -61,14 +45,14 @@ bld.SAMBA3_MODULE('idmap_rfc2307',
 bld.SAMBA3_MODULE('idmap_rid',
                  subsystem='idmap',
                  allow_undefined_symbols=True,
-                 source=IDMAP_RID_SRC,
+                 source='idmap_rid.c',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_rid'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_rid'))
 
 bld.SAMBA3_MODULE('idmap_passdb',
                  subsystem='idmap',
-                 source=IDMAP_PASSDB_SRC,
+                 source='idmap_passdb.c',
                  deps='samba-util pdb',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_passdb'),
@@ -76,7 +60,7 @@ bld.SAMBA3_MODULE('idmap_passdb',
 
 bld.SAMBA3_MODULE('idmap_ldap',
                  subsystem='idmap',
-                 source=IDMAP_LDAP_SRC,
+                 source='idmap_ldap.c',
                  deps='smbldap smbldaphelper pdb IDMAP_RW',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ldap'),
@@ -85,7 +69,7 @@ bld.SAMBA3_MODULE('idmap_ldap',
 
 bld.SAMBA3_MODULE('idmap_nss',
                  subsystem='idmap',
-                 source=IDMAP_NSS_SRC,
+                 source='idmap_nss.c',
                  deps='samba-util',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_nss'),
@@ -93,7 +77,7 @@ bld.SAMBA3_MODULE('idmap_nss',
 
 bld.SAMBA3_MODULE('idmap_tdb',
                  subsystem='idmap',
-                 source=IDMAP_TDB_SRC,
+                 source='idmap_tdb.c',
                  deps='samba-util tdb IDMAP_TDB_COMMON',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_tdb'),
@@ -101,7 +85,7 @@ bld.SAMBA3_MODULE('idmap_tdb',
 
 bld.SAMBA3_MODULE('idmap_tdb2',
                  subsystem='idmap',
-                 source=IDMAP_TDB2_SRC,
+                 source='idmap_tdb2.c',
                  deps='samba-util tdb IDMAP_TDB_COMMON',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_tdb2'),
@@ -118,26 +102,22 @@ bld.SAMBA3_MODULE('idmap_hash',
 
 bld.SAMBA3_MODULE('idmap_autorid',
                  subsystem='idmap',
-                 source=IDMAP_AUTORID_SRC,
+                 source='idmap_autorid.c',
                  deps='samba-util tdb IDMAP_TDB_COMMON',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_autorid'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_autorid'),
                   allow_undefined_symbols=True)
 
-
-NSS_INFO_TEMPLATE_SRC = 'nss_info_template.c'
-NSS_INFO_SRC = 'nss_info.c'
-
 bld.SAMBA3_LIBRARY('nss_info',
-                   source=NSS_INFO_SRC,
+                   source='nss_info.c',
                    deps='samba-util param',
                    vars=locals(),
                    private_library=True)
 
 bld.SAMBA3_MODULE('nss_info_template',
                  subsystem='nss_info',
-                 source=NSS_INFO_TEMPLATE_SRC,
+                 source='nss_info_template.c',
                  deps='samba-util krb5samba',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('nss_info_template'),
-- 
1.7.9.5


From 6fdbab7b693d3f87b3410e959fe5cc2458560cf8 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sun, 22 Sep 2013 23:20:12 +0200
Subject: [PATCH 4/6] build: remove vars=locals() from the IDMAP_HASH
 subsystem: there is no need for this

Might have been a copy'n'paste.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/winbindd/wscript_build |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index b1aa65e..6c2cab7 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -16,8 +16,7 @@ bld.SAMBA3_SUBSYSTEM('IDMAP_TDB_COMMON',
 
 bld.SAMBA3_SUBSYSTEM('IDMAP_HASH',
                     source='idmap_hash/idmap_hash.c idmap_hash/mapfile.c',
-                    deps='samba-util krb5samba',
-                    vars=locals())
+                    deps='samba-util krb5samba')
 
 bld.SAMBA3_SUBSYSTEM('IDMAP_AD',
                     source='idmap_ad.c',
-- 
1.7.9.5


From fd4e2b809bb2a8653fc04315282b24a8d30f935b Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sun, 22 Sep 2013 23:21:01 +0200
Subject: [PATCH 5/6] build: remove vars=locals() from the nss_info library:
 there is no need for this

Might have been a copy'n'paste.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/winbindd/wscript_build |    1 -
 1 file changed, 1 deletion(-)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 6c2cab7..250037f 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -111,7 +111,6 @@ bld.SAMBA3_MODULE('idmap_autorid',
 bld.SAMBA3_LIBRARY('nss_info',
                    source='nss_info.c',
                    deps='samba-util param',
-                   vars=locals(),
                    private_library=True)
 
 bld.SAMBA3_MODULE('nss_info_template',
-- 
1.7.9.5


From f3eccacd8c429b812cae74fc8aa26314de27adde Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sun, 22 Sep 2013 21:11:40 +0200
Subject: [PATCH 6/6] build: fix spacing in the definition of the
 "idmap_autorid" target

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/winbindd/wscript_build |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 250037f..1c957e5 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -106,7 +106,7 @@ bld.SAMBA3_MODULE('idmap_autorid',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_autorid'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_autorid'),
-                  allow_undefined_symbols=True)
+                 allow_undefined_symbols=True)
 
 bld.SAMBA3_LIBRARY('nss_info',
                    source='nss_info.c',
-- 
1.7.9.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 215 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130923/4f4dbfde/attachment.pgp>


More information about the samba-technical mailing list