vfs: Add new VFS module vfs_nfs4acl_xattr to use nfs4acl.idl
[samba.git] / source3 / wscript
index 7a99dc1c552695c2777e3a63fb390f7e5bccf5ba..5a3805fc15170e9b9dac444699df7ca03eeee375 100644 (file)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
 
 srcdir=".."
 
@@ -41,11 +41,14 @@ def set_options(opt):
     opt.SAMBA3_ADD_OPTION('syslog')
     opt.SAMBA3_ADD_OPTION('automount')
     opt.SAMBA3_ADD_OPTION('aio-support')
-    opt.SAMBA3_ADD_OPTION('dmapi', default=False, help="build with DMAPI support")
+    opt.SAMBA3_ADD_OPTION('dmapi', default=None) # None means autodetection
+    opt.SAMBA3_ADD_OPTION('fam', default=None) # None means autodetection
     opt.SAMBA3_ADD_OPTION('profiling-data', default=False)
 
     opt.SAMBA3_ADD_OPTION('cluster-support', default=None)
 
+    opt.SAMBA3_ADD_OPTION('regedit', default=None)
+
     opt.add_option('--with-ctdb-dir',
                    help=("Directory under which ctdb is installed"),
                    action="store", dest='ctdb_dir', default=None)
@@ -53,6 +56,10 @@ def set_options(opt):
                   help=("enable building against (too) old version of ctdb (default=false)"),
                   action="store_true", dest='enable_old_ctdb', default=False)
 
+    opt.add_option('--with-libcephfs',
+                   help=("Directory under which libcephfs is installed"),
+                   action="store", dest='libcephfs_dir', default=None)
+
 
 
 def configure(conf):
@@ -163,6 +170,32 @@ main() {
 }''', 'HAVE_KERNEL_SHARE_MODES', addmain=False, execute=True,
         msg="Checking for kernel share modes")
 
+    # check for fam libs
+    samba_fam_libs=None
+    check_for_fam=False
+    if Options.options.with_fam is None:
+        check_for_fam=True
+    elif Options.options.with_fam == True:
+        check_for_fam=True
+
+    if check_for_fam and conf.CHECK_HEADERS('fam.h'):
+        if conf.CHECK_FUNCS_IN('FAMOpen2', 'fam'):
+            samba_fam_libs='fam'
+        elif conf.CHECK_FUNCS_IN('FAMOpen2', 'fam C'):
+            samba_fam_libs='fam C'
+        conf.CHECK_TYPE('enum FAMCodes', headers='fam.h',
+            define='HAVE_FAM_H_FAMCODES_TYPEDEF',
+            msg='Checking whether enum FAMCodes is available')
+        conf.CHECK_FUNCS_IN('FAMNoExists', 'fam')
+
+    if samba_fam_libs is not None:
+        conf.DEFINE('SAMBA_FAM_LIBS', samba_fam_libs)
+    else:
+        if Options.options.with_fam == True:
+            conf.fatal('FAM support requested, but no suitable FAM library found')
+        elif check_for_fam:
+            Logs.warn('no suitable FAM library found')
+
     # check for DMAPI libs
     Logs.info("Checking for DMAPI library existence")
     conf.env['dmapi_lib'] = ''
@@ -317,7 +350,7 @@ _lstat __lstat lutimes
 __lxstat memalign mknod mlock mlockall munlock munlockall
 _open __open _opendir __opendir
 pathconf poll posix_fallocate
-posix_memalign prctl pread _pread __pread
+posix_memalign pread _pread __pread
 pwrite _pwrite __pwrite
 rdchk _read __read _readdir __readdir
 _seekdir __seekdir
@@ -330,14 +363,6 @@ __sys_llseek syslog _telldir __telldir textdomain timegm
 utimensat vsyslog _write __write __xstat
 ''')
 
-    conf.CHECK_CODE('''
-#ifdef HAVE_SYS_PRCTL_H
-#include <sys/prctl.h>
-#endif
-int i; i = prtcl(0); 
-''', 
-                    'HAVE_PRCTL', link=False)
-
     conf.CHECK_SAMBA3_CHARSET() # see build/charset.py
 
     # FIXME: these should be tests for features, but the old build system just
@@ -1677,6 +1702,35 @@ main() {
     if conf.CHECK_HEADERS('gpfs_gpl.h'):
         conf.DEFINE('HAVE_GPFS', '1')
 
+    if conf.CHECK_HEADERS('linux/ioctl.h sys/ioctl.h'):
+           conf.DEFINE('HAVE_LINUX_IOCTL', '1')
+
+    conf.env['CCFLAGS_CEPHFS'] = "-D_FILE_OFFSET_BITS=64"
+    if Options.options.libcephfs_dir:
+        conf.env['CPPPATH_CEPHFS'] = Options.options.libcephfs_dir + '/include'
+        conf.env['LIBPATH_CEPHFS'] = Options.options.libcephfs_dir + '/lib'
+
+    if conf.CHECK_HEADERS('cephfs/libcephfs.h', False, False, 'cephfs') and conf.CHECK_LIB('cephfs'):
+        conf.DEFINE('HAVE_CEPH', '1')
+
+    conf.env.build_regedit = False
+    if not Options.options.with_regedit == False:
+        conf.PROCESS_SEPARATE_RULE('system_ncurses')
+        if conf.CONFIG_SET('HAVE_NCURSES'):
+            conf.env.build_regedit = True
+
+    if conf.env.build_regedit:
+        Logs.info("building regedit")
+    else:
+        if Options.options.with_regedit == False:
+            Logs.info("not building regedit (--without-regedit)")
+        elif Options.options.with_regedit == True:
+            Logs.error("ncurses not available, cannot build regedit")
+            conf.fatal("ncurses not available, but --with-regedit was specified")
+        else:
+            Logs.info("ncurses not available, not building regedit")
+
+
     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
@@ -1693,7 +1747,7 @@ main() {
                                      vfs_commit
                                       vfs_crossrename vfs_linux_xfs_sgid
                                       vfs_time_audit idmap_autorid idmap_tdb2
-                                      idmap_rid idmap_hash'''))
+                                      idmap_rid idmap_hash idmap_rfc2307'''))
 
     if Options.options.developer:
         default_static_modules.extend(TO_LIST('charset_weird'))
@@ -1702,7 +1756,7 @@ main() {
         default_shared_modules.extend(TO_LIST('auth_skel pdb_test'))
 
     if Options.options.enable_selftest or Options.options.developer:
-        default_shared_modules.extend(TO_LIST('vfs_fake_acls'))
+       default_shared_modules.extend(TO_LIST('vfs_fake_acls vfs_nfs4acl_xattr'))
         
 
     if conf.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
@@ -1738,6 +1792,15 @@ main() {
     if conf.CONFIG_SET('HAVE_GPFS'):
        default_shared_modules.extend(TO_LIST('vfs_gpfs'))
 
+    if conf.CONFIG_SET('HAVE_LINUX_IOCTL'):
+       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'))
+
     explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',')
     explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',')