From: John Mulligan Date: Thu, 5 Jun 2025 20:47:55 +0000 (-0400) Subject: build: add '--with-varlink' configure option X-Git-Tag: tdb-1.4.15~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c25fb47e0b8de7c18bcb8b7409603b9c35e7df7;p=thirdparty%2Fsamba.git build: add '--with-varlink' configure option When building with varlink support, require explicit '--with-varlink' configure option to be set. If set, allow ceph+fscrypt configuration. Pair-Programmed-With: Shachar Sharon Signed-off-by: Shachar Sharon Signed-off-by: John Mulligan Reviewed-by: Gunther Deschner Reviewed-by: Anoop C S --- diff --git a/source3/modules/wscript_build b/source3/modules/wscript_build index 121369e6155..d078293763d 100644 --- a/source3/modules/wscript_build +++ b/source3/modules/wscript_build @@ -47,6 +47,14 @@ bld.SAMBA3_SUBSYSTEM('HASH_INODE', source='hash_inode.c', deps='gnutls') +bld.SAMBA3_SUBSYSTEM('VARLINK_KEYBRIDGE', + source='varlink_keybridge.c', + enabled=( + bld.SAMBA3_IS_ENABLED_MODULE('vfs_ceph_new') + and bld.env.with_varlink + ), + deps='varlink') + # # This is always be static, see # source3/wscript: required_static_modules @@ -542,7 +550,7 @@ bld.SAMBA3_MODULE('vfs_ceph', bld.SAMBA3_MODULE('vfs_ceph_new', subsystem='vfs', source='vfs_ceph_new.c', - deps='POSIXACL_XATTR samba-util', + deps='POSIXACL_XATTR VARLINK_KEYBRIDGE samba-util', init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_ceph_new'), enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_ceph_new'), diff --git a/source3/wscript b/source3/wscript index c6d2aff0aa6..06f329e05ae 100644 --- a/source3/wscript +++ b/source3/wscript @@ -613,15 +613,19 @@ msg.msg_accrightslen = sizeof(fd); conf.env.build_winbind = True conf.DEFINE('WITH_WINBIND', '1') - if Options.options.with_systemd_userdb: + if Options.options.with_varlink or Options.options.with_systemd_userdb: conf.CHECK_CFG(package='libvarlink', args='"libvarlink >= 24" --cflags --libs', msg='Checking for libvarlink >= 24', mandatory=True) - if conf.CHECK_HEADERS('varlink.h', lib='varlink') and conf.CHECK_LIB('varlink', shlib=True): - if conf.CHECK_FUNCS_IN('varlink_service_new', 'varlink', headers='varlink.h'): - conf.env.with_systemd_userdb = True - conf.DEFINE('WITH_SYSTEMD_USERDB', '1') - if not conf.env.with_systemd_userdb: + if (conf.CHECK_HEADERS('varlink.h', lib='varlink') and + conf.CHECK_LIB('varlink', shlib=True) and + conf.CHECK_FUNCS_IN('varlink_service_new', 'varlink', headers='varlink.h')): + conf.env.with_varlink = True + else: conf.fatal("libvarlink not found.") + if Options.options.with_systemd_userdb: + conf.env.with_systemd_userdb = True + conf.DEFINE('WITH_SYSTEMD_USERDB', '1') + conf.find_program('awk', var='AWK') @@ -1659,6 +1663,15 @@ int main(void) { headers='cephfs/libcephfs.h')): conf.DEFINE('HAVE_CEPH_ASYNCIO', '1') + ceph_fscrypt = conf.CHECK_FUNCS_IN( + 'ceph_ll_set_fscrypt_policy_v2', + 'cephfs', + headers='cephfs/libcephfs.h', + ) + fscrypt = conf.CHECK_HEADERS('linux/fscrypt.h') + if conf.env.with_varlink and ceph_fscrypt and fscrypt: + conf.DEFINE('HAVE_CEPH_FSCRYPT', '1') + if conf.CONFIG_SET('HAVE_CEPH'): Logs.info("building ceph vfs modules") else: diff --git a/wscript b/wscript index 5159572860f..a14fd20e40c 100644 --- a/wscript +++ b/wscript @@ -162,6 +162,11 @@ def options(opt): "Varlink"), default=False) + opt.add_option('--with-varlink', + help=("Build with Varlink support"), + action='store_true', + dest='with_varlink') + def configure(conf): if Options.options.SAMBA_VERSION_VENDOR_SUFFIX: conf.env.SAMBA_VERSION_VENDOR_SUFFIX = Options.options.SAMBA_VERSION_VENDOR_SUFFIX