opt.BUNDLED_EXTENSION_DEFAULT('s3')
opt.RECURSE('../lib/replace')
opt.RECURSE('build')
+ opt.RECURSE('selftest')
opt.RECURSE('../lib/nss_wrapper')
opt.RECURSE('../lib/socket_wrapper')
opt.RECURSE('../lib/tevent')
opt.add_option('--with-static-modules',
help=("Comma-separated list of names of modules to statically link in"),
- action="store", dest='static_modules', default='')
+ action="store", dest='static_modules', default=None)
opt.add_option('--with-shared-modules',
help=("Comma-separated list of names of modules to build shared"),
- action="store", dest='shared_modules', default='')
+ action="store", dest='shared_modules', default=None)
opt.add_option('--enable-selftest',
help=("enable options necessary for selftest"),
action="store_true", dest='enable_selftest', default=False)
opt.SAMBA3_ADD_OPTION('pthreadpool', with_name="enable", without_name="disable")
opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable")
opt.SAMBA3_ADD_OPTION('iconv')
+ opt.SAMBA3_ADD_OPTION('acl-support')
def configure(conf):
if Options.options.with_swat:
conf.env['build_swat'] = True
- # set a limit on recursing in the waf preprocessor
- conf.env.preprocessor_recursion_limit = 10
-
conf.ADD_EXTRA_INCLUDES('''#source3 #source3/include #lib/replace #lib/talloc
#lib/tevent #source3/libaddns #source3/librpc
#source3/lib #lib/tdb/include #lib/popt #source4''')
conf.RECURSE('../lib/nss_wrapper')
conf.RECURSE('../lib/socket_wrapper')
conf.RECURSE('../lib/zlib')
+ conf.RECURSE('../libcli/smbreadline')
conf.CHECK_HEADERS('execinfo.h libexc.h libunwind.h netdb.h')
conf.CHECK_SAMBA3_CHARSET() # see build/charset.py
+ # FIXME: these should be tests for features, but the old build system just
+ # checks for OSes.
+ import sys
+ host_os = sys.platform
+
+ # Python doesn't have case switches... :/
+ # FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu | *qnx*)
+ # the search for .rfind('gnu') covers gnu* and *-gnu is that too broad?
+ if (host_os.rfind('linux') > -1) or (host_os.rfind('gnu') > -1) or (host_os.rfind('qnx') > -1):
+ if host_os.rfind('linux') > -1:
+ conf.DEFINE('LINUX', '1')
+ elif host_os.rfind('qnx') > -1:
+ conf.DEFINE('QNX', '1')
+ conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
+ elif (host_os.rfind('darwin') > -1):
+ conf.DEFINE('DARWINOS', 1)
+ conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
+ conf.ADD_CFLAGS('-fno-common')
+ # FIXME: Add more checks here.
+ else:
+ print "Unknown host_os '%s', please report this to samba-technical@samba.org" % host_os
- default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam rpc_lsarpc rpc_samr
+ #FIXME: add more checks
+ if Options.options.with_acl_support:
+ if host_os.rfind('linux') > -1:
+ conf.CHECK_FUNCS_IN('acl_get_file', 'acl')
+ conf.CHECK_FUNCS_IN('getxattr', 'attr')
+ if conf.CHECK_CODE('''
+acl_t acl;
+int entry_id;
+acl_entry_t *entry_p;
+return acl_get_entry(acl, entry_id, entry_p);
+''',
+ 'HAVE_POSIX_ACLS',
+ headers='sys/types.h sys/acl.h', link=False,
+ msg="Checking for POSIX ACL support") :
+ conf.CHECK_CODE('''
+acl_permset_t permset_d;
+acl_perm_t perm;
+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")
+ else:
+ conf.DEFINE('HAVE_NO_ACLS', 1)
+ conf.SET_TARGET_TYPE('acl', 'EMPTY')
+ conf.SET_TARGET_TYPE('attr', 'EMPTY')
+
+
+ default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam pdb_ldap rpc_lsarpc rpc_samr
rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl
rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss
rpc_eventlog auth_sam auth_unix auth_winbind auth_wbc auth_server
auth_domain auth_builtin auth_netlogond vfs_default
- nss_info_template''')
+ nss_info_template idmap_tdb idmap_passdb
+ idmap_nss''')
default_shared_modules=TO_LIST('''vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk
vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap
charset_CP437 auth_script vfs_readahead vfs_xattr_tdb
vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb
vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly
- vfs_crossrename''')
+ vfs_crossrename vfs_linux_xfs_sgid''')
if Options.options.developer:
default_static_modules.extend(TO_LIST('rpc_rpcecho pdb_ads'))
default_shared_modules.extend(TO_LIST('charset_weird perfcount_test'))
- move_to_shared = TO_LIST(Options.options.shared_modules)
- move_to_static = TO_LIST(Options.options.static_modules)
+ if Options.options.with_acl_support:
+ default_static_modules.extend(TO_LIST('vfs_posixacl'))
+
+ explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',')
+ explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',')
+
+ final_static_modules = default_static_modules
+ final_shared_modules = default_shared_modules
- for m in move_to_static:
- if m in default_shared_modules:
- default_shared_modules.remove(m)
- default_static_modules.append(m)
- for m in move_to_shared:
- if m in default_static_modules:
- default_static_modules.remove(m)
- default_shared_modules.append(m)
+ for m in explicit_static_modules:
+ if m in final_shared_modules:
+ final_shared_modules.remove(m)
+ final_static_modules.append(m)
+ for m in explicit_shared_modules:
+ if m in final_static_modules:
+ final_static_modules.remove(m)
+ final_shared_modules.append(m)
- conf.DEFINE('STRING_STATIC_MODULES', ' '.join(default_static_modules), quote=True)
+ conf.env['static_modules'] = final_static_modules
+ conf.env['shared_modules'] = final_shared_modules
+
+ conf.DEFINE('STRING_STATIC_MODULES', ' '.join(final_static_modules), quote=True)
static_list = {}
shared_list = {}
prefixes = ['vfs', 'pdb', 'rpc', 'auth', 'nss_info', 'charset', 'idmap', 'gpext', 'perfcount']
conf.env['MODULE_PREFIXES'] = prefixes
for p in prefixes:
- for m in default_static_modules:
+ for m in final_static_modules:
if m.find(p) == 0:
if not p in static_list:
static_list[p] = []
static_list[p].append(m)
- for m in default_shared_modules:
+ for m in final_shared_modules:
if m.find(p) == 0:
if not p in shared_list:
shared_list[p] = []
conf.DEFINE('WITH_WINBIND', '1')
conf.find_program('awk', var='AWK')
+ conf.find_program('perl', var='PERL')
# Darwin has extra options to xattr-family functions
conf.CHECK_CODE('getxattr(0, 0, 0, 0, 0, 0);',
headers='krb5.h stdlib.h', lib='krb5',
addmain=False, cflags='-Werror',
msg="Checking whether krb5_enctype_to_string takes krb5_context argument")
+ conf.DEFINE('HAVE_KRB5', '1')
else:
conf.SET_TARGET_TYPE('krb5', 'EMPTY')
conf.SET_TARGET_TYPE('gssapi', 'EMPTY')
conf.SET_TARGET_TYPE('gssapi_krb5', 'EMPTY')
+ conf.SET_TARGET_TYPE('com_err', 'EMPTY')
+ conf.SET_TARGET_TYPE('k5crypto', 'EMPTY')
if Options.options.with_utmp:
conf.CHECK_FUNCS('pututline pututxline updwtmp updwtmpx getutmpx getutxent')
if conf.env.with_iconv:
conf.DEFINE('HAVE_ICONV', 1)
- # FIXME: these should be tests for features, but the old build system just
- # checks for OSes.
- import sys
- host_os = sys.platform
+ if Options.options.with_pam:
+ conf.CHECK_HEADERS('security/pam_appl.h security/pam_modules.h pam/pam_modules.h', together=True)
+ conf.CHECK_FUNCS_IN('pam_start', 'pam', checklibc=True, headers='security/pam_appl.h')
+
+ seteuid = False
+ if not seteuid:
+ seteuid = conf.CHECK_CODE('''
+ #define AUTOCONF_TEST 1
+ #define USE_SETREUID 1
+ #include "./lib/util_sec.c"
+ ''',
+ 'USE_SETREUID',
+ addmain=False,
+ execute=True,
+ msg="Checking whether setreuid is available")
+ if not seteuid:
+ seteuid = conf.CHECK_CODE('''
+ #define AUTOCONF_TEST 1
+ #define USE_SETRESUID 1
+ #include "./lib/util_sec.c"
+ ''',
+ 'USE_SETRESUID',
+ addmain=False,
+ execute=True,
+ msg="Checking whether setresuid is available")
+ if not seteuid:
+ seteuid = conf.CHECK_CODE('''
+ #define AUTOCONF_TEST 1
+ #define USE_SETEUID 1
+ #include "./lib/util_sec.c"
+ ''',
+ 'USE_SETEUID',
+ addmain=False,
+ execute=True,
+ msg="Checking whether seteuid is available")
+ if not seteuid:
+ seteuid = conf.CHECK_CODE('''
+ #define AUTOCONF_TEST 1
+ #define USE_SETUIDX 1
+ #include "./lib/util_sec.c"
+ ''',
+ 'USE_SETUIDX',
+ addmain=False,
+ execute=True,
+ mandatory=True,
+ msg="Checking whether setuidx is available")
- # Python doesn't have case switches... :/
- # FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu | *qnx*)
- # the search for .rfind('gnu') covers gnu* and *-gnu is that too broad?
- if (host_os.rfind('linux') > -1) or (host_os.rfind('gnu') > -1) or (host_os.rfind('qnx') > -1):
- if host_os.rfind('linux') > -1:
- conf.DEFINE('LINUX', '1')
- elif host_os.rfind('qnx') > -1:
- conf.DEFINE('QNX', '1')
- conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
- elif (host_os.rfind('darwin') > -1):
- conf.DEFINE('DARWINOS', 1)
- conf.DEFINE('STAT_ST_BLOCKSIZE', '512')
- conf.ADD_CFLAGS('-fno-common')
- # FIXME: Add more checks here.
- else:
- print "Unknown host_os '%s', please report this to samba-technical@samba.org" % host_os
conf.SAMBA_CONFIG_H('include/config.h')