diff options
author | Günther Deschner <gd@samba.org> | 2010-09-26 10:56:09 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-09-27 00:39:37 +0200 |
commit | 2839c8f0b2aab9693a41b844c0733af893f1f2a9 (patch) | |
tree | 55fce5df3c3ddd909eae91c31b52da72335f4acf /source3 | |
parent | 89e151167cb90c08236c5eda880732031752b915 (diff) | |
download | samba-2839c8f0b2aab9693a41b844c0733af893f1f2a9.tar.gz samba-2839c8f0b2aab9693a41b844c0733af893f1f2a9.tar.bz2 samba-2839c8f0b2aab9693a41b844c0733af893f1f2a9.zip |
s3-waf: support --with-acl-support, at least for posix acls.
Guenther
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/wscript_build | 2 | ||||
-rw-r--r-- | source3/wscript | 75 |
2 files changed, 55 insertions, 22 deletions
diff --git a/source3/modules/wscript_build b/source3/modules/wscript_build index 73e189958a..48edd0c168 100644 --- a/source3/modules/wscript_build +++ b/source3/modules/wscript_build @@ -105,6 +105,7 @@ bld.SAMBA_MODULE('VFS_FULL_AUDIT', bld.SAMBA_MODULE('VFS_FAKE_PERMS', subsystem='VFS', source=VFS_FAKE_PERMS_SRC, + deps='acl attr', init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('VFS_FAKE_PERMS'), enabled=bld.SAMBA3_IS_ENABLED_MODULE('VFS_FAKE_PERMS')) @@ -182,6 +183,7 @@ bld.SAMBA_MODULE('VFS_XATTR_TDB', bld.SAMBA_MODULE('VFS_POSIXACL', subsystem='VFS', source=VFS_POSIXACL_SRC, + deps='acl attr', init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('VFS_POSIXACL'), enabled=bld.SAMBA3_IS_ENABLED_MODULE('VFS_POSIXACL')) diff --git a/source3/wscript b/source3/wscript index fc91858351..8f65b15fe7 100644 --- a/source3/wscript +++ b/source3/wscript @@ -50,6 +50,7 @@ def set_options(opt): 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): @@ -263,6 +264,55 @@ utimensat vsyslog _write __write __xstat 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 + + #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 @@ -283,6 +333,9 @@ utimensat vsyslog _write __write __xstat default_static_modules.extend(TO_LIST('rpc_rpcecho pdb_ads')) default_shared_modules.extend(TO_LIST('charset_weird perfcount_test')) + if Options.options.with_acl_support: + default_static_modules.extend(TO_LIST('vfs_posixacl')) + move_to_shared = TO_LIST(Options.options.shared_modules) move_to_static = TO_LIST(Options.options.static_modules) @@ -647,28 +700,6 @@ return 0; msg="Checking whether setuidx is available") - # 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 - conf.SAMBA_CONFIG_H('include/config.h') def ctags(ctx): |