-#! /usr/bin/env python
+#!/usr/bin/env python
srcdir=".."
action="store", dest='shared_modules', default=None)
opt.SAMBA3_ADD_OPTION('winbind')
- opt.SAMBA3_ADD_OPTION('swat')
- opt.SAMBA3_ADD_OPTION('ads', default=None) # None means autodetection
+ opt.SAMBA3_ADD_OPTION('ads')
opt.SAMBA3_ADD_OPTION('ldap')
opt.SAMBA3_ADD_OPTION('cups', with_name="enable", without_name="disable")
opt.SAMBA3_ADD_OPTION('iprint', with_name="enable", without_name="disable")
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('libarchive', default=None)
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)
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)
+
+ opt.SAMBA3_ADD_OPTION('glusterfs', with_name="enable", without_name="disable", default=True)
def configure(conf):
conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
conf.env.developer = True
- if Options.options.with_swat:
- conf.env['build_swat'] = True
-
if sys.platform != 'openbsd5':
conf.ADD_LDFLAGS("-Wl,--export-dynamic", testflags=True)
conf.CHECK_FUNCS('fseeko setluid')
conf.CHECK_FUNCS('getpwnam', headers='sys/types.h pwd.h')
conf.CHECK_FUNCS('fdopendir')
+ conf.CHECK_FUNCS('fstatat')
conf.CHECK_FUNCS('getpwent_r setenv strcasecmp fcvt fcvtl')
conf.CHECK_FUNCS('syslog vsyslog timegm setlocale')
conf.CHECK_FUNCS_IN('nanosleep', 'rt')
conf.CHECK_FUNCS('memalign posix_memalign hstrerror')
conf.CHECK_FUNCS('shmget')
conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True)
- conf.CHECK_FUNCS('gettext dgettext bindtextdomain textdomain bind_textdomain_codeset')
#FIXME: for some reason this one still fails
conf.CHECK_FUNCS_IN('yp_get_default_domain', 'nsl')
conf.CHECK_FUNCS_IN('dn_expand _dn_expand __dn_expand', 'resolv')
}''', '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 libarchive (tar command in smbclient)
+ # None means autodetect, True/False means enable/disable
+ if Options.options.with_libarchive is not False:
+ libarchive_mandatory = Options.options.with_libarchive == True
+ Logs.info("Checking for libarchive existence")
+ conf.CHECK_LIB('archive', mandatory=libarchive_mandatory)
+ if not conf.CHECK_HEADERS('archive.h') and libarchive_mandatory:
+ conf.fatal('libarchive support requested, but no suitable header found')
+
# check for DMAPI libs
Logs.info("Checking for DMAPI library existence")
conf.env['dmapi_lib'] = ''
conf.CHECK_FUNCS('''
_acl __acl atexit
-bindtextdomain _chdir __chdir chflags chmod _close __close _closedir
-__closedir crypt16 devnm dgettext dirfd
+ _chdir __chdir chflags chmod _close __close _closedir
+__closedir crypt16 devnm dirfd
DNSServiceRegister _dup __dup _dup2 __dup2 endmntent execl
_facl __facl _fchdir
__fchdir fchmod fchown _fcntl __fcntl fcvt fcvtl fdatasync
futimens futimes __fxstat getauthuid
getcwd _getcwd __getcwd getdents __getdents getdirentries
getgrent getgrnam getgrouplist getgrset getmntent getpagesize
-getpwanam getpwent_r getrlimit gettext
+getpwanam getpwent_r getrlimit
glob grantpt hstrerror initgroups innetgr
llseek _llseek __llseek _lseek __lseek
_lstat __lstat lutimes
shmget shm_open sigaction sigblock sigprocmask sigset
_stat __stat statvfs
strcasecmp strchr strpbrk strsignal strtol strupr sysconf sysctl sysctlbyname
-__sys_llseek syslog _telldir __telldir textdomain timegm
+__sys_llseek syslog _telldir __telldir timegm
utimensat vsyslog _write __write __xstat
''')
elif (host_os.rfind('aix') > -1):
Logs.info('Using AIX ACLs')
conf.DEFINE('HAVE_AIX_ACLS',1)
- default_static_modules.extend(TO_LIST('vfs_aixacl'))
+ default_static_modules.extend(TO_LIST('vfs_aixacl vfs_aixacl2'))
elif (host_os.rfind('osf') > -1) and conf.CHECK_FUNCS_IN('pacl', 'acl_get_fd'):
Logs.info('Using Tru64 ACLs')
conf.DEFINE('HAVE_TRU64_ACLS',1)
default_static_modules.extend(TO_LIST('vfs_tru64acl'))
elif (host_os.rfind('darwin') > -1):
- Logs.warn('ACLs on Dwarwin currently not supported')
+ Logs.warn('ACLs on Darwin currently not supported')
+ conf.fatal("ACL support not available on Darwin/MacOS. "
+ "Use --without-acl-support for building without "
+ "ACL support. "
+ "ACL support is required to change permissions "
+ "from Windows clients.")
else:
conf.CHECK_FUNCS_IN('acl_get_file', 'acl')
if conf.CHECK_CODE('''
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'))
-
+ else:
+ conf.fatal("ACL support not found. Try installing libacl1-dev "
+ "or libacl-devel. "
+ "Otherwise, use --without-acl-support to build "
+ "without ACL support. "
+ "ACL support is required to change permissions from "
+ "Windows clients.")
if conf.CHECK_FUNCS('dirfd'):
conf.DEFINE('HAVE_DIRFD_DECL', 1)
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 not use_ads_krb5:
Logs.warn("Active Directory support not available: krb5 libs don't have all required features")
if not use_ads_ldap:
- Logs.warn("Active Directory support not available: LDAP support ist not available.")
+ Logs.warn("Active Directory support not available: LDAP support is not available.")
if Options.options.with_ads:
- conf.fatal("Active Directory support not found. Use --without-ads for building without Active Directory support.")
+ conf.fatal("Active Directory support not found. Use --without-ads "
+ "for building without Active Directory support. "
+ "ADS support improves communication with "
+ "Active Directory domain controllers.")
else:
# this is the auto-mode case
Logs.warn("Building without Active Directory support.")
else:
Logs.warn("ignoring missing SCHEDULE_FOR_DELETION control (--enable-old-ctdb)")
+ if have_cluster_support:
+ conf.CHECK_CODE('''
+ #define NO_CONFIG_H
+ #include "replace.h"
+ #include "system/wait.h"
+ #include "system/network.h"
+ #include <talloc.h>
+ #include <tdb.h>
+ #include <ctdb.h>
+
+ int main(void)
+ {
+ int i = (int)CTDB_WANT_READONLY;
+ return 0;
+ }
+ ''',
+ 'HAVE_CTDB_WANT_READONLY_DECL',
+ addmain=False,
+ includes=includes,
+ msg='Checking for CTDB readonly records support')
+
+ if not conf.CONFIG_SET('HAVE_CTDB_WANT_READONLY_DECL'):
+ if not Options.options.enable_old_ctdb:
+ have_cluster_support = False
+ ctdb_broken = "support for CTDB readonly records missing"
+ else:
+ Logs.warn("ignoring missing READONLY support (--enable-old-ctdb)")
+
if have_cluster_support:
conf.CHECK_CODE('''
#define NO_CONFIG_H
if conf.CHECK_HEADERS('gpfs_gpl.h'):
conf.DEFINE('HAVE_GPFS', '1')
- if conf.CHECK_HEADERS('linux/ioctl.h sys/ioctl.h'):
+ if (conf.CHECK_HEADERS('linux/ioctl.h sys/ioctl.h linux/fs.h') and
+ conf.CHECK_DECLS('FS_IOC_GETFLAGS FS_COMPR_FL', headers='linux/fs.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')
+
+ if Options.options.with_glusterfs:
+ conf.check_cfg(package='glusterfs-api', args='"glusterfs-api >= 4" --cflags --libs',
+ msg='Checking for glusterfs-api >= 4', uselib_store="GFAPI")
+ conf.CHECK_HEADERS('api/glfs.h', lib='gfapi')
+ conf.CHECK_LIB('gfapi', shlib=True)
+
+ if conf.CONFIG_SET('HAVE_API_GLFS_H'):
+ conf.DEFINE('HAVE_GLUSTERFS', '1')
+ else:
+ conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
+ conf.undefine('HAVE_GLUSTERFS')
+ else:
+ conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
+ conf.undefine('HAVE_GLUSTERFS')
+
+ 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
vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly
vfs_media_harmony
vfs_commit
+ vfs_worm
vfs_crossrename vfs_linux_xfs_sgid
vfs_time_audit idmap_autorid idmap_tdb2
- idmap_rid idmap_hash'''))
+ idmap_ad
+ idmap_rid idmap_hash idmap_rfc2307'''))
if Options.options.developer:
default_static_modules.extend(TO_LIST('charset_weird'))
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'):
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'))
+
+ if conf.CONFIG_SET('HAVE_GLUSTERFS'):
+ default_shared_modules.extend(TO_LIST('vfs_glusterfs'))
+
explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',')
explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',')