test a static build of smbtorture and smbd

Stefan Metzmacher metze at samba.org
Mon Aug 17 20:57:00 UTC 2015


Hi,

while
https://git.samba.org/?p=samba.git;a=commitdiff;h=e8c602dfa2f08a9ea43c84a7e7ae9fe17e007d60
fixed the build using --nonshared-binary=smbtorture

Here're a patchset to test this in autobuild.

At the same time I improved our --with-{static,shared}-modules handling.

Please review and push.

Thanks!
metze

-------------- next part --------------
From 280be348ddb5cd9aafb369826ad46af5c01bf9e1 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 15:04:14 +0200
Subject: [PATCH 01/15] s3:wscript: fix the build without any idmap module

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/winbindd/wscript_build | 15 ++++++++-------
 source3/wscript                |  4 ++--
 source3/wscript_build          |  1 +
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 2f7e74d..7fce463 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -2,7 +2,7 @@
 
 bld.SAMBA3_LIBRARY('idmap',
                    source='idmap.c idmap_util.c',
-                   deps='samba-util',
+                   deps='samba-util pdb',
                    allow_undefined_symbols=True,
                    private_library=True)
 
@@ -16,12 +16,13 @@ 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')
+                    deps='samba-util krb5samba',
+                    enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_hash'))
 
 bld.SAMBA3_SUBSYSTEM('IDMAP_AD',
                     source='idmap_ad.c',
                     deps='ads nss_info',
-                    enabled=bld.CONFIG_SET("HAVE_LDAP"))
+                    enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad'))
 
 bld.SAMBA3_MODULE('idmap_ad',
                  subsystem='idmap',
@@ -30,7 +31,7 @@ bld.SAMBA3_MODULE('idmap_ad',
                  deps='IDMAP_AD',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ad'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.CONFIG_SET("HAVE_LDAP"))
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad'))
 
 bld.SAMBA3_MODULE('idmap_rfc2307',
                  subsystem='idmap',
@@ -39,7 +40,7 @@ bld.SAMBA3_MODULE('idmap_rfc2307',
                  init_function='',
                  deps='ads',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_rfc2307'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_rfc2307') and bld.CONFIG_SET("HAVE_LDAP"))
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_rfc2307'))
 
 bld.SAMBA3_MODULE('idmap_rid',
                  subsystem='idmap',
@@ -141,7 +142,7 @@ bld.SAMBA3_MODULE('nss_info_rfc2307',
                  allow_undefined_symbols=True,
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ad'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.CONFIG_SET("HAVE_LDAP"))
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad'))
 
 bld.SAMBA3_MODULE('nss_info_sfu20',
                  subsystem='nss_info',
@@ -150,7 +151,7 @@ bld.SAMBA3_MODULE('nss_info_sfu20',
                  allow_undefined_symbols=True,
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ad'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.CONFIG_SET("HAVE_LDAP"))
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad'))
 
 bld.SAMBA3_MODULE('nss_info_sfu',
                  subsystem='nss_info',
diff --git a/source3/wscript b/source3/wscript
index 4e940fa..8dcde59 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -797,6 +797,7 @@ msg.msg_accrightslen = sizeof(fd);
         conf.DEFINE('WITH_ADS', '1')
         conf.env['HAVE_ADS'] = '1'
         Logs.info("Building with Active Directory support.")
+        default_shared_modules.extend(TO_LIST('idmap_ad idmap_rfc2307'))
     elif Options.options.with_ads == False:
         Logs.info("Building without Active Directory support (--without-ads).")
     else:
@@ -1589,9 +1590,8 @@ main() {
 				      vfs_worm
                                       vfs_crossrename vfs_linux_xfs_sgid
                                       vfs_time_audit idmap_autorid idmap_tdb2
-                                      idmap_ad
 				      idmap_script
-                                      idmap_rid idmap_hash idmap_rfc2307'''))
+                                      idmap_rid idmap_hash'''))
 
     if Options.options.developer:
         default_static_modules.extend(TO_LIST('charset_weird'))
diff --git a/source3/wscript_build b/source3/wscript_build
index ace4b99..6a0762f 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1310,6 +1310,7 @@ bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3,
                  LOCKING
                  NDR_OPEN_FILES
                  idmap
+                 IDMAP_TDB_COMMON
                  samba-cluster-support
                  ''',
                  cflags='-DWINBINDD_SOCKET_DIR=\"%s\"' % bld.env.WINBINDD_SOCKET_DIR,
-- 
1.9.1


From 9c049c4aa04da9135153de6b0af132d5dd1e6c80 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 20:07:59 +0200
Subject: [PATCH 02/15] s3:idmap: we need to allow undefined symbols in
 idmap_tdb

When idmap_tdb is build as shared module we need to allow undefined symbols
which callback into winbindd code.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/winbindd/wscript_build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 7fce463..3ee280c 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -80,6 +80,7 @@ bld.SAMBA3_MODULE('idmap_tdb',
                  source='idmap_tdb.c',
                  deps='samba-util tdb IDMAP_TDB_COMMON',
                  init_function='',
+                 allow_undefined_symbols=True,
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_tdb'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_tdb'))
 
-- 
1.9.1


From e4d2e3a24f2c1bc48ff900709277c2952a371c7c Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:15:03 +0200
Subject: [PATCH 03/15] s3:wscript: remove leftover from vfs_notify_fam

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/modules/wscript_build | 4 ----
 source3/wscript               | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/source3/modules/wscript_build b/source3/modules/wscript_build
index e618b08..e6576ac 100644
--- a/source3/modules/wscript_build
+++ b/source3/modules/wscript_build
@@ -281,10 +281,6 @@ bld.SAMBA3_MODULE('vfs_gpfs',
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_gpfs'),
                  includes=bld.CONFIG_GET('CPPPATH_GPFS'))
 
-vfs_notify_fam_deps='samba-util '
-if bld.CONFIG_SET('SAMBA_FAM_LIBS'):
-   vfs_notify_fam_deps += bld.CONFIG_GET('SAMBA_FAM_LIBS')
-
 bld.SAMBA3_MODULE('vfs_readahead',
                  subsystem='vfs',
                  source='vfs_readahead.c',
diff --git a/source3/wscript b/source3/wscript
index 8dcde59..2c4fe3b 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1640,9 +1640,6 @@ main() {
       and conf.CONFIG_SET('HAVE_BASENAME') and conf.CONFIG_SET('HAVE_DIRNAME')):
 	default_shared_modules.extend(TO_LIST('vfs_btrfs'))
 
-    if conf.CONFIG_SET('SAMBA_FAM_LIBS'):
-        default_shared_modules.extend(TO_LIST('vfs_notify_fam'))
-
     if conf.CONFIG_SET("HAVE_CEPH"):
         default_shared_modules.extend(TO_LIST('vfs_ceph'))
 
-- 
1.9.1


From c8049acfff008253c2cf014ec0b775073257246a Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:15:36 +0200
Subject: [PATCH 04/15] s4:ntvfs/posix: fix forward declaration of struct
 pvfs_state

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/ntvfs/posix/posix_eadb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source4/ntvfs/posix/posix_eadb.h b/source4/ntvfs/posix/posix_eadb.h
index 752d322..14b9439 100644
--- a/source4/ntvfs/posix/posix_eadb.h
+++ b/source4/ntvfs/posix/posix_eadb.h
@@ -16,5 +16,5 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-struct pvfs_state *pvfs;
+struct pvfs_state;
 #include "source4/ntvfs/posix/posix_eadb_proto.h"
-- 
1.9.1


From 6b58e8ed23d0eb0039de3f316be7ed5dedefe17d Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:16:20 +0200
Subject: [PATCH 05/15] examples/pdb: fix and validate pdb_test_init()
 prototype via static_decl_pdb;

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 examples/pdb/test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/pdb/test.c b/examples/pdb/test.c
index 5780130..6d68d87 100644
--- a/examples/pdb/test.c
+++ b/examples/pdb/test.c
@@ -107,8 +107,8 @@ static NTSTATUS testsam_init(struct pdb_methods **pdb_method, const char *locati
 	return NT_STATUS_OK;
 }
 
-NTSTATUS pdb_testsam_init(void);
-NTSTATUS pdb_testsam_init(void)
+static_decl_pdb;
+NTSTATUS pdb_test_init(void)
 {
 	return smb_register_passdb(PASSDB_INTERFACE_VERSION, "testsam",
 				   testsam_init);
-- 
1.9.1


From bd0e708b1e63d78db26b0cbd1cc71c6bb1d489e9 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:16:20 +0200
Subject: [PATCH 06/15] examples/VFS: make function prototypes available via
 static_decl_vfs;

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 examples/VFS/shadow_copy_test.c | 1 +
 examples/VFS/skel_opaque.c      | 1 +
 examples/VFS/skel_transparent.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/examples/VFS/shadow_copy_test.c b/examples/VFS/shadow_copy_test.c
index b3a99ca..05d6e16 100644
--- a/examples/VFS/shadow_copy_test.c
+++ b/examples/VFS/shadow_copy_test.c
@@ -83,6 +83,7 @@ static struct vfs_fn_pointers vfs_test_shadow_copy_fns = {
 	.get_shadow_copy_data_fn = test_get_shadow_copy_data
 };
 
+static_decl_vfs;
 NTSTATUS vfs_shadow_copy_test_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 7021998..29fe6f4 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -961,6 +961,7 @@ struct vfs_fn_pointers skel_opaque_fns = {
 	.set_offline_fn = skel_set_offline
 };
 
+static_decl_vfs;
 NTSTATUS vfs_skel_opaque_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque",
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 6c6adea..c5a36a6 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -1070,6 +1070,7 @@ struct vfs_fn_pointers skel_transparent_fns = {
 	.set_offline_fn = skel_set_offline
 };
 
+static_decl_vfs;
 NTSTATUS vfs_skel_transparent_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent",
-- 
1.9.1


From 61f2a1987f103559a8677231697a3138be1bdeee Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:16:20 +0200
Subject: [PATCH 07/15] s3:modules/vfs_*: make function prototypes available
 via static_decl_vfs;

This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/modules/vfs_acl_tdb.c              | 1 +
 source3/modules/vfs_acl_xattr.c            | 1 +
 source3/modules/vfs_aio_linux.c            | 1 +
 source3/modules/vfs_audit.c                | 1 +
 source3/modules/vfs_catia.c                | 1 +
 source3/modules/vfs_dirsort.c              | 1 +
 source3/modules/vfs_extd_audit.c           | 1 +
 source3/modules/vfs_full_audit.c           | 1 +
 source3/modules/vfs_posix_eadb.c           | 2 +-
 source3/modules/vfs_scannedonly.c          | 1 +
 source3/modules/vfs_smb_traffic_analyzer.c | 1 +
 source3/modules/vfs_syncops.c              | 1 +
 12 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index 1537ba3..c7acf43 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -403,6 +403,7 @@ static struct vfs_fn_pointers vfs_acl_tdb_fns = {
 	.sys_acl_set_fd_fn = sys_acl_set_fd_tdb
 };
 
+static_decl_vfs;
 NTSTATUS vfs_acl_tdb_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "acl_tdb",
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index c1b0a60..710fbf3 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -214,6 +214,7 @@ static struct vfs_fn_pointers vfs_acl_xattr_fns = {
 	.sys_acl_set_fd_fn = sys_acl_set_fd_xattr
 };
 
+static_decl_vfs;
 NTSTATUS vfs_acl_xattr_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "acl_xattr",
diff --git a/source3/modules/vfs_aio_linux.c b/source3/modules/vfs_aio_linux.c
index 5b515d8..db5f075 100644
--- a/source3/modules/vfs_aio_linux.c
+++ b/source3/modules/vfs_aio_linux.c
@@ -348,6 +348,7 @@ static struct vfs_fn_pointers vfs_aio_linux_fns = {
 	.fsync_recv_fn = aio_linux_int_recv,
 };
 
+static_decl_vfs;
 NTSTATUS vfs_aio_linux_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c
index 6963c37..02e8f35 100644
--- a/source3/modules/vfs_audit.c
+++ b/source3/modules/vfs_audit.c
@@ -283,6 +283,7 @@ static struct vfs_fn_pointers vfs_audit_fns = {
 	.fchmod_acl_fn = audit_fchmod_acl
 };
 
+static_decl_vfs;
 NTSTATUS vfs_audit_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "audit",
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index f455afd..c17ffa8 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -1005,6 +1005,7 @@ static struct vfs_fn_pointers vfs_catia_fns = {
 	.setxattr_fn = catia_setxattr,
 };
 
+static_decl_vfs;
 NTSTATUS vfs_catia_init(void)
 {
 	NTSTATUS ret;
diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c
index 224229f..d164088 100644
--- a/source3/modules/vfs_dirsort.c
+++ b/source3/modules/vfs_dirsort.c
@@ -358,6 +358,7 @@ static struct vfs_fn_pointers vfs_dirsort_fns = {
 	.closedir_fn = dirsort_closedir,
 };
 
+static_decl_vfs;
 NTSTATUS vfs_dirsort_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "dirsort",
diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c
index 93ae7e6..7d6b4d3 100644
--- a/source3/modules/vfs_extd_audit.c
+++ b/source3/modules/vfs_extd_audit.c
@@ -360,6 +360,7 @@ static struct vfs_fn_pointers vfs_extd_audit_fns = {
 	.fchmod_acl_fn = audit_fchmod_acl,
 };
 
+static_decl_vfs;
 NTSTATUS vfs_extd_audit_init(void)
 {
 	NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 6de22b1..11f5d82 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -2323,6 +2323,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
 	.set_offline_fn = smb_full_audit_set_offline,
 };
 
+static_decl_vfs;
 NTSTATUS vfs_full_audit_init(void)
 {
 	NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
diff --git a/source3/modules/vfs_posix_eadb.c b/source3/modules/vfs_posix_eadb.c
index 993c919..20679e1 100644
--- a/source3/modules/vfs_posix_eadb.c
+++ b/source3/modules/vfs_posix_eadb.c
@@ -431,7 +431,7 @@ static struct vfs_fn_pointers vfs_posix_eadb_fns = {
 	.connect_fn = posix_eadb_connect,
 };
 
-NTSTATUS vfs_posix_eadb_init(void);
+static_decl_vfs;
 NTSTATUS vfs_posix_eadb_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "posix_eadb",
diff --git a/source3/modules/vfs_scannedonly.c b/source3/modules/vfs_scannedonly.c
index 0232a15..128374a 100644
--- a/source3/modules/vfs_scannedonly.c
+++ b/source3/modules/vfs_scannedonly.c
@@ -1036,6 +1036,7 @@ static struct vfs_fn_pointers vfs_scannedonly_fns = {
 	.connect_fn = scannedonly_connect
 };
 
+static_decl_vfs;
 NTSTATUS vfs_scannedonly_init(void)
 {
 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "scannedonly",
diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c
index 4938ff7..73ebf63 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -919,6 +919,7 @@ static struct vfs_fn_pointers vfs_smb_traffic_analyzer_fns = {
 };
 
 /* Module initialization */
+static_decl_vfs;
 NTSTATUS vfs_smb_traffic_analyzer_init(void)
 {
 	NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c
index 8ff283d..99f6178 100644
--- a/source3/modules/vfs_syncops.c
+++ b/source3/modules/vfs_syncops.c
@@ -291,6 +291,7 @@ static struct vfs_fn_pointers vfs_syncops_fns = {
 	.close_fn = syncops_close,
 };
 
+static_decl_vfs;
 NTSTATUS vfs_syncops_init(void)
 {
 	NTSTATUS ret;
-- 
1.9.1


From e85ae1908f2f4c717ad9c74a8f7ff6142ac7259b Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:16:20 +0200
Subject: [PATCH 08/15] s3:modules/perfcount_*: make function prototypes
 available via static_decl_perfcount;

This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/modules/perfcount_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source3/modules/perfcount_test.c b/source3/modules/perfcount_test.c
index 0dc073c..ccc74dd 100644
--- a/source3/modules/perfcount_test.c
+++ b/source3/modules/perfcount_test.c
@@ -385,6 +385,7 @@ static struct smb_perfcount_handlers perfcount_test_handlers = {
 	perfcount_test_end
 };
 
+static_decl_perfcount;
 NTSTATUS perfcount_test_init(void)
 {
 	return smb_register_perfcounter(SMB_PERFCOUNTER_INTERFACE_VERSION,
-- 
1.9.1


From 671ea0bfe53c95d5f7e738ae735278f622d1cab8 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:16:20 +0200
Subject: [PATCH 09/15] s3:winbindd/idmap_*: make function prototypes available
 via static_decl_idmap;

This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/winbindd/idmap_ad.c              | 1 +
 source3/winbindd/idmap_autorid.c         | 1 +
 source3/winbindd/idmap_hash/idmap_hash.c | 1 +
 source3/winbindd/idmap_rfc2307.c         | 1 +
 source3/winbindd/idmap_rid.c             | 1 +
 source3/winbindd/idmap_script.c          | 1 +
 source3/winbindd/idmap_tdb2.c            | 1 +
 7 files changed, 7 insertions(+)

diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index 5f7ab63..bc9d785 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -962,6 +962,7 @@ static struct nss_info_methods nss_sfu20_methods = {
  Initialize the plugins
  ***********************************************************************/
 
+static_decl_idmap;
 NTSTATUS idmap_ad_init(void)
 {
 	static NTSTATUS status_idmap_ad = NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index eeac2b0..76dccaa 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -824,6 +824,7 @@ static struct idmap_methods autorid_methods = {
 	.allocate_id	 = idmap_autorid_allocate_id
 };
 
+static_decl_idmap;
 NTSTATUS idmap_autorid_init(void)
 {
 	return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION,
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c
index 1dbd300..51bbf5b 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -366,6 +366,7 @@ static struct nss_info_methods hash_nss_methods = {
  state.
  **********************************************************************/
 
+static_decl_idmap;
 NTSTATUS idmap_hash_init(void)
 {
 	static NTSTATUS idmap_status = NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/winbindd/idmap_rfc2307.c b/source3/winbindd/idmap_rfc2307.c
index e9d04c3..6b3ab4a 100644
--- a/source3/winbindd/idmap_rfc2307.c
+++ b/source3/winbindd/idmap_rfc2307.c
@@ -861,6 +861,7 @@ static struct idmap_methods rfc2307_methods = {
 	.sids_to_unixids = idmap_rfc2307_sids_to_unixids,
 };
 
+static_decl_idmap;
 NTSTATUS idmap_rfc2307_init(void)
 {
 	return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "rfc2307",
diff --git a/source3/winbindd/idmap_rid.c b/source3/winbindd/idmap_rid.c
index 099f68c..d6c649b 100644
--- a/source3/winbindd/idmap_rid.c
+++ b/source3/winbindd/idmap_rid.c
@@ -185,6 +185,7 @@ static struct idmap_methods rid_methods = {
 	.sids_to_unixids = idmap_rid_sids_to_unixids,
 };
 
+static_decl_idmap;
 NTSTATUS idmap_rid_init(void)
 {
 	return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "rid", &rid_methods);
diff --git a/source3/winbindd/idmap_script.c b/source3/winbindd/idmap_script.c
index 3a0d685..e758b4e 100644
--- a/source3/winbindd/idmap_script.c
+++ b/source3/winbindd/idmap_script.c
@@ -388,6 +388,7 @@ static struct idmap_methods db_methods = {
 	.sids_to_unixids = idmap_script_sids_to_unixids,
 };
 
+static_decl_idmap;
 NTSTATUS idmap_script_init(void)
 {
 	return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "script", &db_methods);
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c
index ddd4dbf..1b75936 100644
--- a/source3/winbindd/idmap_tdb2.c
+++ b/source3/winbindd/idmap_tdb2.c
@@ -609,6 +609,7 @@ static struct idmap_methods db_methods = {
 	.allocate_id     = idmap_tdb_common_get_new_id
 };
 
+static_decl_idmap;
 NTSTATUS idmap_tdb2_init(void)
 {
 	return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "tdb2", &db_methods);
-- 
1.9.1


From 5391019d5b59fbf213e3871d82cb7965424783be Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 18:57:19 +0200
Subject: [PATCH 10/15] s3:wscript: simplify ABI matching for pdb_*_init()

The init functions of all static modules should be ignored.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/wscript_build | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/source3/wscript_build b/source3/wscript_build
index 6a0762f..f6351bf 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -105,30 +105,21 @@ bld.SAMBA3_SUBSYSTEM('TLDAP',
 # when modules are not linked statically. In the latter case
 # symbols will not be present in the libpdb anyway so no hurt is
 # done to the version script.
-static_pdb_match = ['tdbsam', 'smbpasswd', 'wbc_sam']
 private_pdb_match = []
-
-# AD DC module when linked statically will pull in few source4/winbind
-# dependencies which are not used outside AD DC module
-static_pdb_match.append('samba_dsdb')
 private_pdb_match.append('!idmap_init')
 private_pdb_match.append('!idmap_sids_to_xids')
 private_pdb_match.append('!idmap_xids_to_sids')
 
-# ldap module is actually three modules merged together: ldapsam, ipa, and nds
-static_pdb_match = static_pdb_match + ['ldap', 'ipa', 'nds']
 ldapsam_pdb_match = ['!priv2ld', '!smbldap_search_domain_info',
                      '!ldapsam_*', '!groupmap_attr_list*', '!get_userattr_list',
                      '!dominfo_attr_list', '!get_attr_key2string',
                      '!sidmap_attr_list', '!attrib_map_*', '!idpool_attr_list',
                      '!get_attr_list']
 private_pdb_match.append('!pdb_nds_*')
-private_pdb_match.append('!pdb_init_ldapsam')
 private_pdb_match.append('!pdb_ldapsam_init*')
+private_pdb_match.append('!pdb_*_init')
 private_pdb_match = private_pdb_match + ldapsam_pdb_match
 
-private_pdb_match = private_pdb_match + map(lambda x: '!pdb_%s_init' % x, static_pdb_match)
-
 bld.SAMBA3_LIBRARY('samba-passdb',
                    source='',
                    deps='pdb',
-- 
1.9.1


From b893b7cff368ed3918c40b5480063ac65faa5123 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 14:22:45 +0200
Subject: [PATCH 11/15] s3:wscript: make --with-{static,shared}-modules options
 more flexible

'!module' disables a non-required module for a static/shared build.
'!DEFAULT' disables all modules defaulting to a static/shared build.
'!FORCED' disables all (non-required) modules forced to a static/shared build.
'ALL' switches the default for all non forced modules from static to shared
or from shared to static.
The most specific specification wins
e.g.
--with-static-modules='!FORCED,!DEFAULT' --with-shared-modules='!FORCED,!DEFAULT' will only
build modules which are quired for the compilation. Might be useful
if someone only wants to use client utils.

--with-static-modules=ALL will build all modules statically linked.

--with-static-modules='!DEFAULT,ALL' --with-shared-modules='!DEFAULT,ALL'
might be useful for testing, it reverses the default build for all modules
which can be build shared or static.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/wscript | 120 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 94 insertions(+), 26 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 2c4fe3b..4918951 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -16,10 +16,24 @@ Options.default_prefix = '/usr/local/samba'
 def set_options(opt):
 
     opt.add_option('--with-static-modules',
-                   help=("Comma-separated list of names of modules to statically link in"),
+                   help=("Comma-separated list of names of modules to statically link in. "+
+                         "May include !module to disable 'module'. "+
+                         "Can be '!FORCED' to disable all non-required static only modules. "+
+                         "Can be '!DEFAULT' to disable all modules defaulting to a static build. "+
+                         "Can be 'ALL' to build all default shared modules static. "+
+                         "The most specific one wins, while the order is ignored "+
+                         "and --with-static-modules is evaluated before "+
+                         "--with-shared-modules"),
                    action="store", dest='static_modules', default=None)
     opt.add_option('--with-shared-modules',
-                   help=("Comma-separated list of names of modules to build shared"),
+                   help=("Comma-separated list of names of modules to build shared. "+
+                         "May include !module to disable 'module'. "+
+                         "Can be '!FORCED' to disable all non-required shared only modules. "+
+                         "Can be '!DEFAULT' to disable all modules defaulting to a shared build. "+
+                         "Can be 'ALL' to build all default static modules shared. "+
+                         "The most specific one wins, while the order is ignored "+
+                         "and --with-static-modules is evaluated before "+
+                         "--with-shared-modules"),
                    action="store", dest='shared_modules', default=None)
 
     opt.SAMBA3_ADD_OPTION('winbind')
@@ -69,6 +83,9 @@ def configure(conf):
 
     default_static_modules = []
     default_shared_modules = []
+    required_static_modules = []
+    forced_static_modules = []
+    forced_shared_modules = []
 
     if Options.options.developer:
         conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
@@ -77,6 +94,9 @@ def configure(conf):
     if sys.platform != 'openbsd5':
         conf.ADD_LDFLAGS("-Wl,--export-dynamic", testflags=True)
 
+    # We crash without vfs_default
+    required_static_modules.extend(TO_LIST('vfs_default'))
+
     conf.CHECK_HEADERS('execinfo.h libexc.h libunwind.h netdb.h')
     conf.CHECK_HEADERS('linux/falloc.h linux/ioctl.h')
 
@@ -469,7 +489,8 @@ return acl_get_perm_np(permset_d, perm);
                         'HAVE_ACL_GET_PERM_NP',
                         headers='sys/types.h sys/acl.h', link=True,
                         msg="Checking whether acl_get_perm_np() is available")
-                default_static_modules.extend(TO_LIST('vfs_posixacl'))
+                # source3/lib/sysacls.c calls posixacl_sys_acl_get_file()
+                required_static_modules.extend(TO_LIST('vfs_posixacl'))
                 conf.CHECK_VARIABLE('ACL_EVERYONE', headers='sys/acl.h')
             elif conf.CHECK_FUNCS_IN(['facl'], 'sec'):
                 Logs.info('Using solaris or UnixWare ACLs')
@@ -797,7 +818,8 @@ msg.msg_accrightslen = sizeof(fd);
         conf.DEFINE('WITH_ADS', '1')
         conf.env['HAVE_ADS'] = '1'
         Logs.info("Building with Active Directory support.")
-        default_shared_modules.extend(TO_LIST('idmap_ad idmap_rfc2307'))
+        # these have broken dependencies
+        forced_shared_modules.extend(TO_LIST('idmap_ad idmap_rfc2307'))
     elif Options.options.with_ads == False:
         Logs.info("Building without Active Directory support (--without-ads).")
     else:
@@ -1573,25 +1595,26 @@ main() {
             conf.fatal("Spotlight support requested but tracker-sparql library missing")
         Logs.info("building with Spotlight support")
 
+    forced_static_modules.extend(TO_LIST('auth_domain auth_builtin auth_sam auth_winbind'))
     default_static_modules.extend(TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam
-                                      auth_sam auth_unix auth_winbind auth_wbc
-                                      auth_domain auth_builtin vfs_default
+                                      auth_unix auth_wbc
                                       nss_info_template idmap_tdb idmap_passdb
                                       idmap_nss'''))
 
-    default_shared_modules.extend(TO_LIST('''vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk
+    default_shared_modules.extend(TO_LIST('''
+                                      vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk
                                       vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap
-                                      vfs_expand_msdfs vfs_shadow_copy vfs_shadow_copy2 
-                                      auth_script vfs_readahead vfs_xattr_tdb vfs_posix_eadb
+                                      vfs_expand_msdfs vfs_shadow_copy vfs_shadow_copy2
+                                      vfs_readahead vfs_xattr_tdb vfs_posix_eadb
                                       vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb
                                       vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly
-				      vfs_media_harmony vfs_unityed_media vfs_fruit vfs_shell_snap
-				      vfs_commit
-				      vfs_worm
-                                      vfs_crossrename vfs_linux_xfs_sgid
-                                      vfs_time_audit idmap_autorid idmap_tdb2
-				      idmap_script
-                                      idmap_rid idmap_hash'''))
+                                      vfs_media_harmony vfs_unityed_media vfs_fruit vfs_shell_snap
+                                      vfs_commit vfs_worm vfs_crossrename vfs_linux_xfs_sgid
+                                      vfs_time_audit
+                                  '''))
+    default_shared_modules.extend(TO_LIST('auth_script idmap_tdb2 idmap_script'))
+    # these have broken dependencies
+    forced_shared_modules.extend(TO_LIST('idmap_autorid idmap_rid idmap_hash'))
 
     if Options.options.developer:
         default_static_modules.extend(TO_LIST('charset_weird'))
@@ -1668,23 +1691,66 @@ main() {
     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
+    final_static_modules = []
+    final_static_modules.extend(TO_LIST(required_static_modules))
+    final_shared_modules = []
+
+    if '!FORCED' not in explicit_static_modules:
+        final_static_modules.extend(TO_LIST(forced_static_modules))
+    if '!FORCED' not in explicit_shared_modules:
+        final_shared_modules.extend(TO_LIST(forced_shared_modules))
+    if '!DEFAULT' not in explicit_static_modules:
+        final_static_modules.extend(TO_LIST(default_static_modules))
+    if '!DEFAULT' not in explicit_shared_modules:
+        final_shared_modules.extend(TO_LIST(default_shared_modules))
+
+    if 'ALL' in explicit_static_modules:
+        for m in default_shared_modules:
+            if m in final_shared_modules:
+                final_shared_modules.remove(m)
+            final_static_modules.append(m)
+    if 'ALL' in explicit_shared_modules:
+        for m in default_static_modules:
+            if m in final_static_modules:
+                final_static_modules.remove(m)
+            final_shared_modules.append(m)
 
     for m in explicit_static_modules:
+        if m in ['ALL','!DEFAULT','!FORCED']:
+            continue
+        if m.startswith('!'):
+            m = m[1:]
+            if m in required_static_modules:
+                raise Utils.WafError('These modules are REQUIRED as static modules: %s' %
+                                     ' '.join(required_static_modules))
+            if m in final_static_modules:
+                final_static_modules.remove(m)
+            continue
+        if m in forced_shared_modules:
+            raise Utils.WafError('These modules MUST be configured as shared modules: %s' %
+                                 ' '.join(forced_shared_modules))
         if m in final_shared_modules:
             final_shared_modules.remove(m)
-        final_static_modules.append(m)
+        if m not in final_static_modules:
+            final_static_modules.append(m)
     for m in explicit_shared_modules:
+        if m in ['ALL','!DEFAULT','!FORCED']:
+            continue
+        if m.startswith('!'):
+            m = m[1:]
+            if m in final_shared_modules:
+                final_shared_modules.remove(m)
+            continue
+        if m in required_static_modules:
+            raise Utils.WafError('These modules are REQUIRED as static modules: %s' %
+                                 ' '.join(required_static_modules))
+        if m in forced_static_modules:
+            raise Utils.WafError('These module MUST be configured as static modules: %s' %
+                                 ' '.join(forced_static_modules))
         if m in final_static_modules:
             final_static_modules.remove(m)
-        final_shared_modules.append(m)
-
-    if ("auth_domain" not in final_static_modules) or \
-            ("auth_builtin" not in final_static_modules) or \
-            ("auth_sam" not in final_static_modules) or \
-            ("auth_winbind" not in final_static_modules):
-        raise Utils.WafError('These auth modules MUST be configured as static modules: auth_domain, auth_builtin, auth_sam, auth_winbind')
+        if m not in final_shared_modules:
+            final_shared_modules.append(m)
 
     conf.env['static_modules'] = final_static_modules
     conf.env['shared_modules'] = final_shared_modules
@@ -1728,6 +1794,8 @@ main() {
             for entry in shared_list[p]:
                 conf.DEFINE('%s_init' % entry, 'samba_init_module')
                 conf.env[shared_env].append('%s' % entry)
+        Logs.info("%s: %s" % (static_env, ','.join(conf.env[static_env])))
+        Logs.info("%s: %s" % (shared_env, ','.join(conf.env[shared_env])))
 
     conf.SAMBA_CONFIG_H('include/config.h')
 
-- 
1.9.1


From c81a8b49b5755026c0ab38702b94a5c558e0f9b2 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 17:34:42 +0200
Subject: [PATCH 12/15] script/autobuild.py: split out a samba_libs_configure
 variable

The avoids too long lines.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 script/autobuild.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/script/autobuild.py b/script/autobuild.py
index d2662b9..1120c84 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -41,6 +41,12 @@ defaulttasks = [ "ctdb", "samba", "samba-xc", "samba-ctdb", "samba-libs", "ldb",
 
 samba_configure_params = " --picky-developer ${PREFIX} --with-profiling-data"
 
+samba_libs_envvars =  "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH"
+samba_libs_envvars += " PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig"
+samba_libs_configure_base = samba_libs_envvars + " ./configure --abi-check --enable-debug -C ${PREFIX}"
+samba_libs_configure_libs = samba_libs_configure_base + " --bundled-libraries=NONE"
+samba_libs_configure_samba = samba_libs_configure_base + " --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent"
+
 tasks = {
     "ctdb" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
                ("configure", "./configure ${PREFIX}", "text/plain"),
@@ -89,23 +95,23 @@ tasks = {
 
     "samba-libs" : [
                       ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
-                      ("talloc-configure", "cd lib/talloc && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
+                      ("talloc-configure", "cd lib/talloc && " + samba_libs_configure_libs, "text/plain"),
                       ("talloc-make", "cd lib/talloc && make", "text/plain"),
                       ("talloc-install", "cd lib/talloc && make install", "text/plain"),
 
-                      ("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
+                      ("tdb-configure", "cd lib/tdb && " + samba_libs_configure_libs, "text/plain"),
                       ("tdb-make", "cd lib/tdb && make", "text/plain"),
                       ("tdb-install", "cd lib/tdb && make install", "text/plain"),
 
-                      ("tevent-configure", "cd lib/tevent && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
+                      ("tevent-configure", "cd lib/tevent && " + samba_libs_configure_libs, "text/plain"),
                       ("tevent-make", "cd lib/tevent && make", "text/plain"),
                       ("tevent-install", "cd lib/tevent && make install", "text/plain"),
 
-                      ("ldb-configure", "cd lib/ldb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
+                      ("ldb-configure", "cd lib/ldb && " + samba_libs_configure_libs, "text/plain"),
                       ("ldb-make", "cd lib/ldb && make", "text/plain"),
                       ("ldb-install", "cd lib/ldb && make install", "text/plain"),
 
-                      ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
+                      ("configure", samba_libs_configure_samba, "text/plain"),
                       ("make", "make", "text/plain"),
                       ("install", "make install", "text/plain"),
                       ("dist", "make dist", "text/plain")],
-- 
1.9.1


From c99097e729020a4bb5d3b41292a7daa7c458e2c0 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Fri, 14 Aug 2015 08:40:37 +0200
Subject: [PATCH 13/15] script/autobuild.py: use -Wmissing-prototypes and
 --picky-developer for samba-libs*

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 script/autobuild.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/script/autobuild.py b/script/autobuild.py
index 1120c84..242a2fb 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -43,7 +43,8 @@ samba_configure_params = " --picky-developer ${PREFIX} --with-profiling-data"
 
 samba_libs_envvars =  "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH"
 samba_libs_envvars += " PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig"
-samba_libs_configure_base = samba_libs_envvars + " ./configure --abi-check --enable-debug -C ${PREFIX}"
+samba_libs_envvars += " ADDITIONAL_CFLAGS='-Wmissing-prototypes'"
+samba_libs_configure_base = samba_libs_envvars + " ./configure --abi-check --enable-debug --picky-developer -C ${PREFIX}"
 samba_libs_configure_libs = samba_libs_configure_base + " --bundled-libraries=NONE"
 samba_libs_configure_samba = samba_libs_configure_base + " --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent"
 
-- 
1.9.1


From 9036aa45f726701433c8612ed42308aeafc3f571 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 17:38:43 +0200
Subject: [PATCH 14/15] script/autobuild.py: test some
 --with-{static,shared}-modules combinations

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 script/autobuild.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/script/autobuild.py b/script/autobuild.py
index 242a2fb..2b939eb 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -115,7 +115,22 @@ tasks = {
                       ("configure", samba_libs_configure_samba, "text/plain"),
                       ("make", "make", "text/plain"),
                       ("install", "make install", "text/plain"),
-                      ("dist", "make dist", "text/plain")],
+                      ("dist", "make dist", "text/plain"),
+
+                      # retry with all modules shared
+                      ("allshared-distclean", "make distclean", "text/plain"),
+                      ("allshared-configure", samba_libs_configure_samba + " --with-shared-modules=ALL", "text/plain"),
+                      ("allshared-make", "make", "text/plain"),
+
+                      # retry with all modules static
+                      ("allstatic-distclean", "make distclean", "text/plain"),
+                      ("allstatic-configure", samba_libs_configure_samba + " --with-static-modules=ALL", "text/plain"),
+                      ("allstatic-make", "make", "text/plain"),
+
+                      # retry without any required modules
+                      ("none-distclean", "make distclean", "text/plain"),
+                      ("none-configure", samba_libs_configure_samba + " --with-static-modules=!FORCED,!DEFAULT --with-shared-modules=!FORCED,!DEFAULT", "text/plain"),
+                      ("none-make", "make", "text/plain")],
 
     "ldb" : [
               ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
-- 
1.9.1


From 96124ec0f1470feec837de3370681bad144e5176 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 13 Aug 2015 10:32:46 +0200
Subject: [PATCH 15/15] script/autobuild.py: make sure
 --nonshared-binary=smbtorture,smbd/smbd keeps working

- It's very useful to have a static smbtorture binary that can be copied arround.
- It's sometimes also useful to have a static smbd binary in order avoid
  runtime overhead via do_lookup_x() (in ld*.so), note that

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 script/autobuild.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/script/autobuild.py b/script/autobuild.py
index 2b939eb..c91ff2c 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -130,7 +130,12 @@ tasks = {
                       # retry without any required modules
                       ("none-distclean", "make distclean", "text/plain"),
                       ("none-configure", samba_libs_configure_samba + " --with-static-modules=!FORCED,!DEFAULT --with-shared-modules=!FORCED,!DEFAULT", "text/plain"),
-                      ("none-make", "make", "text/plain")],
+                      ("none-make", "make", "text/plain"),
+
+                      # retry with nonshared smbd and smbtorture
+                      ("nonshared-distclean", "make distclean", "text/plain"),
+                      ("nonshared-configure", samba_libs_configure_base + " --bundled-libraries=talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent --with-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd", "text/plain"),
+                      ("nonshared-make", "make", "text/plain")],
 
     "ldb" : [
               ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
-- 
1.9.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150817/eed38ee4/signature-0001.sig>


More information about the samba-technical mailing list