s3:utils: let smbstatus report anonymous signing/encryption explicitly
[samba.git] / source3 / wscript
index 58c7e2aecaf55434bfc5bbe425646f9c6d6dde4e..4048ec5aad50c4be3958e53b7c6f4418e8af4301 100644 (file)
@@ -43,7 +43,7 @@ def options(opt):
 # ------------------
 #
 # Most of the calls to opt.samba_add_onoff_option() implicitly
-# or explicity use default=True
+# or explicitly use default=True
 #
 # To assist users and distributors to build Samba with the full feature
 # set, the build system will abort if our dependent libraries and their
@@ -62,7 +62,6 @@ def options(opt):
 
     opt.samba_add_onoff_option('winbind')
     opt.samba_add_onoff_option('ads')
-    opt.samba_add_onoff_option('ldap')
     opt.samba_add_onoff_option('cups', with_name="enable", without_name="disable")
     opt.samba_add_onoff_option('iprint', with_name="enable", without_name="disable")
     opt.samba_add_onoff_option('pam')
@@ -100,6 +99,7 @@ def options(opt):
 
     # default = None means autodetection
     opt.samba_add_onoff_option('spotlight', with_name="enable", without_name="disable", default=None)
+    opt.samba_add_onoff_option('wsp', with_name="enable", without_name="disable", default=True)
 
 def configure(conf):
     default_static_modules = []
@@ -108,11 +108,6 @@ def configure(conf):
     forced_static_modules = []
     forced_shared_modules = []
 
-    if Options.options.developer:
-        conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
-        conf.env.developer = True
-        conf.DEFINE('HAVE_SMB3_UNIX_EXTENSIONS', '1')
-
     if sys.platform != 'openbsd5':
         conf.ADD_LDFLAGS("-Wl,--export-dynamic", testflags=True)
 
@@ -648,53 +643,6 @@ msg.msg_accrightslen = sizeof(fd);
     if Options.options.with_automount:
         conf.DEFINE('WITH_AUTOMOUNT', '1')
 
-    # Check for LDAP
-    if Options.options.with_ldap:
-        conf.CHECK_HEADERS('ldap.h lber.h ldap_pvt.h')
-        conf.CHECK_TYPE('ber_tag_t', 'unsigned int', headers='ldap.h lber.h')
-        conf.CHECK_FUNCS_IN('ber_scanf ber_sockbuf_add_io', 'lber')
-        conf.CHECK_VARIABLE('LDAP_OPT_SOCKBUF', headers='ldap.h')
-
-        # if we LBER_OPT_LOG_PRINT_FN we can intercept ldap logging and print it out
-        # for the samba logs
-        conf.CHECK_VARIABLE('LBER_OPT_LOG_PRINT_FN',
-                            define='HAVE_LBER_LOG_PRINT_FN', headers='lber.h')
-
-        conf.CHECK_FUNCS_IN('ldap_init ldap_init_fd ldap_initialize ldap_set_rebind_proc', 'ldap')
-        conf.CHECK_FUNCS_IN('ldap_add_result_entry', 'ldap')
-
-        # Check if ldap_set_rebind_proc() takes three arguments
-        if conf.CHECK_CODE('ldap_set_rebind_proc(0, 0, 0)',
-                           'LDAP_SET_REBIND_PROC_ARGS',
-                           msg="Checking whether ldap_set_rebind_proc takes 3 arguments",
-                           headers='ldap.h lber.h', link=False):
-            conf.DEFINE('LDAP_SET_REBIND_PROC_ARGS', '3')
-        else:
-            conf.DEFINE('LDAP_SET_REBIND_PROC_ARGS', '2')
-
-        # last but not least, if ldap_init() exists, we want to use ldap
-        if conf.CONFIG_SET('HAVE_LDAP_INIT') and conf.CONFIG_SET('HAVE_LDAP_H'):
-            conf.DEFINE('HAVE_LDAP', '1')
-            conf.DEFINE('LDAP_DEPRECATED', '1')
-            conf.env['HAVE_LDAP'] = '1'
-            # if ber_sockbuf_add_io() and LDAP_OPT_SOCKBUF are available, we can add
-            # SASL wrapping hooks
-            if conf.CONFIG_SET('HAVE_BER_SOCKBUF_ADD_IO') and \
-                    conf.CONFIG_SET('HAVE_LDAP_OPT_SOCKBUF'):
-                conf.DEFINE('HAVE_LDAP_SASL_WRAPPING', '1')
-        else:
-            conf.fatal("LDAP support not found. "
-                       "Try installing libldap2-dev or openldap-devel. "
-                       "Otherwise, use --without-ldap to build without "
-                       "LDAP support. "
-                       "LDAP support is required for the LDAP passdb backend, "
-                       "LDAP idmap backends and ADS. "
-                       "ADS support improves communication with "
-                       "Active Directory domain controllers.")
-    else:
-        conf.SET_TARGET_TYPE('ldap', 'EMPTY')
-        conf.SET_TARGET_TYPE('lber', 'EMPTY')
-
     if Options.options.with_ads == False:
         use_ads = False
         use_ads_krb5 = False
@@ -775,13 +723,13 @@ msg.msg_accrightslen = sizeof(fd);
             conf.undefine('HAVE_GSSAPI_GSSAPI_H')
             use_ads = False
 
-        if not conf.CONFIG_SET('HAVE_LDAP'):
+        if not conf.CONFIG_SET('HAVE_LDAP_TRANSPORT_WRAPPING'):
+            Logs.warn("need ber_sockbuf_add_io() and LDAP_OPT_SOCKBUF for SASL and TLS support")
             use_ads = False
             use_ads_ldap = False
 
     if use_ads:
-        conf.DEFINE('WITH_ADS', '1')
-        conf.env['HAVE_ADS'] = '1'
+        conf.DEFINE('HAVE_ADS', '1')
         Logs.info("Building with Active Directory support.")
         # these have broken dependencies
         forced_shared_modules.extend(['idmap_ad', 'idmap_rfc2307'])
@@ -808,7 +756,7 @@ msg.msg_accrightslen = sizeof(fd);
     if Options.options.with_utmp:
         conf.env.with_utmp = True
         if not conf.CHECK_HEADERS('utmp.h'): conf.env.with_utmp = False
-        conf.CHECK_FUNCS('pututline pututxline updwtmp updwtmpx getutmpx getutxent')
+        conf.CHECK_FUNCS('pututline pututxline updwtmp updwtmpx getutmpx')
         conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_name', headers='utmp.h',
                                     define='HAVE_UT_UT_NAME')
         conf.CHECK_STRUCTURE_MEMBER('struct utmp', 'ut_user', headers='utmp.h',
@@ -1244,7 +1192,7 @@ err:
             'HAVE_RW_HINTS',
             addmain=False,
             execute=True,
-            msg="Checking whether fcntl supports setting/geting hints")
+            msg="Checking whether fcntl supports setting/getting hints")
 
     conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtim.tv_nsec',
                                 define='HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC') # Linux, Solaris
@@ -1561,7 +1509,7 @@ int main(void) {
                 execute=False,
                 local_include=False)
 
-        # For IRIX like dqb_isoftlimit instead of dqb_fsoftlimit in struc dqblk
+        # For IRIX like dqb_isoftlimit instead of dqb_fsoftlimit in struct dqblk
         conf.CHECK_STRUCTURE_MEMBER('struct dqblk', 'dqb_fsoftlimit', define='HAVE_DQB_FSOFTLIMIT',
                                 headers='sys/quota.h')
         #darwin style quota bytecount
@@ -1649,18 +1597,6 @@ int main(void) {
                     define='HAVE_UNSHARE_CLONE_FS',
                     msg='for Linux unshare(CLONE_FS)')
 
-    # Check for mallinfo
-    conf.CHECK_CODE('''
-    struct mallinfo mi;
-    int tmp;
-
-    mi = mallinfo();
-    tmp = mi.arena + mi.ordblks + mi.smblks + mi.hblks +
-          mi.hblkhd + mi.usmblks + mi.fsmblks +  mi.uordblks +
-          mi.fordblks + mi.keepcost;
-    return tmp;
-    ''', 'HAVE_MALLINFO', msg="Checking for mallinfo()", headers='malloc.h')
-
     #
     # cluster support (CTDB)
     #
@@ -1672,11 +1608,6 @@ int main(void) {
         conf.env.with_ctdb = True
         conf.DEFINE('CLUSTER_SUPPORT', 1)
 
-    conf.CHECK_CODE('void seekdir(DIR *d, long loc) { return; }',
-                    'SEEKDIR_RETURNS_VOID',
-                    headers='sys/types.h dirent.h',
-                    msg='Checking whether seekdir returns void')
-
     if Options.options.with_profiling_data:
         conf.DEFINE('WITH_PROFILE', 1);
         conf.CHECK_FUNCS('getrusage', headers="sys/time.h sys/resource.h")
@@ -1700,6 +1631,20 @@ int main(void) {
             conf.DEFINE('HAVE_CEPH', '1')
             conf.CHECK_FUNCS_IN('ceph_select_filesystem', 'cephfs',
                                 headers='cephfs/libcephfs.h')
+            conf.DEFINE('HAVE_MANDATORY_CEPH_API', '1')
+            for api in ['ceph_mkdirat', 'ceph_openat', 'ceph_unlinkat',
+                        'ceph_symlinkat', 'ceph_readlinkat', 'ceph_statxat',
+                        'ceph_fdopendir']:
+                if not conf.CHECK_FUNCS_IN(api, 'cephfs',
+                                           headers='cephfs/libcephfs.h'):
+                    conf.undefine('HAVE_MANDATORY_CEPH_API')
+            if not conf.env.HAVE_MANDATORY_CEPH_API:
+                Logs.warn("Installed Ceph version support is at the verge of "
+                          "deprecation due to the absence of some mandatory "
+                          "libcephfs APIs. This warning there shall result in "
+                          "disabling the Ceph VFS module altogether with the "
+                          "next major Samba version. It is highly recommended "
+                          "to update to a more recent/active version of Ceph.")
         else:
             Logs.warn('''Ceph support disabled due to --without-acl-support
                       or lack of ceph_statx support''')
@@ -1755,7 +1700,7 @@ int main(void) {
             # when we try to include both files.
             #
             # check if struct open_how is defined in liburing/compat.h
-            # itself and not via inclusing linux/openat2.h
+            # itself and not via including linux/openat2.h
             conf.CHECK_TYPE_IN('struct open_how', 'liburing/compat.h',
                                cflags='-D_LINUX_OPENAT2_H',
                                define='HAVE_STRUCT_OPEN_HOW_LIBURING_COMPAT_H')
@@ -1844,6 +1789,14 @@ int main(void) {
         and conf.CONFIG_GET('HAVE_UTF8_NORMALISATION')
     )
 
+    conf.env.with_wsp = False
+    if conf.CONFIG_GET('ENABLE_SELFTEST'):
+        Options.options.with_wsp = True
+    if Options.options.with_wsp:
+        Logs.info("building with WSP support")
+        conf.DEFINE('WITH_WSP', '1')
+        conf.env.with_wsp = True
+
     conf.env.with_spotlight = False
     if Options.options.with_spotlight is not False:
         backends = ['noindex']
@@ -1911,8 +1864,9 @@ int main(void) {
 
     if Options.options.developer:
         default_static_modules.extend(['charset_weird'])
-        default_shared_modules.extend(['perfcount_test',
-                                       'vfs_skel_opaque', 'vfs_skel_transparent', 'vfs_shadow_copy_test',
+        default_shared_modules.extend(['vfs_skel_opaque',
+                                       'vfs_skel_transparent',
+                                       'vfs_shadow_copy_test',
                                        'pdb_test',
                                        'vfs_fake_dfq',
                                        'gpext_security', 'gpext_registry', 'gpext_scripts'])
@@ -2060,7 +2014,7 @@ int main(void) {
     static_list = {}
     shared_list = {}
 
-    prefixes = ['vfs', 'pdb', 'auth', 'nss_info', 'charset', 'idmap', 'gpext', 'perfcount']
+    prefixes = ['vfs', 'pdb', 'auth', 'nss_info', 'charset', 'idmap', 'gpext']
     conf.env['MODULE_PREFIXES'] = prefixes
     for p in prefixes:
         for m in final_static_modules: