From: Anoop C S Date: Mon, 5 Aug 2024 13:21:49 +0000 (+0530) Subject: source3/wscript: Introduce auto mode to build ceph vfs modules X-Git-Tag: samba-4.21.5~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2900b44971eae1d3c5bd7b50c661202598f7e339;p=thirdparty%2Fsamba.git source3/wscript: Introduce auto mode to build ceph vfs modules Use 'auto' mode as the default for building ceph vfs modules so that an explicit --enable-cephfs can reliably fail in the absence of required dependencies. ref: https://lists.samba.org/archive/samba/2024-August/249569.html BUG: https://bugzilla.samba.org/show_bug.cgi?id=15810 Signed-off-by: Anoop C S Reviewed-by: Guenther Deschner Autobuild-User(master): Anoop C S Autobuild-Date(master): Tue Aug 27 06:18:51 UTC 2024 on atb-devel-224 (cherry picked from commit 232ab02faf9615c55c362c60e06381ea02421794) --- diff --git a/source3/wscript b/source3/wscript index 2cf537704b2..f746a67b800 100644 --- a/source3/wscript +++ b/source3/wscript @@ -87,7 +87,7 @@ def options(opt): help=("Include AFS fake-kaserver support"), default=False) opt.samba_add_onoff_option('glusterfs', with_name="enable", without_name="disable", default=True) - opt.samba_add_onoff_option('cephfs', with_name="enable", without_name="disable", default=True) + opt.samba_add_onoff_option('cephfs', with_name="enable", without_name="disable", default=None) opt.add_option('--enable-vxfs', help=("enable support for VxFS (default=no)"), @@ -1619,17 +1619,27 @@ int main(void) { conf.env['CFLAGS_CEPHFS'] = "-D_FILE_OFFSET_BITS=64" - if (Options.options.with_cephfs and + if (Options.options.with_cephfs is not False and conf.CHECK_HEADERS('cephfs/libcephfs.h', False, False, 'cephfs') and conf.CHECK_LIB('cephfs', shlib=True)): if (Options.options.with_acl_support and conf.CHECK_FUNCS_IN('ceph_statx ceph_openat', 'cephfs', headers='cephfs/libcephfs.h')): conf.DEFINE('HAVE_CEPH', '1') + + if conf.CONFIG_SET('HAVE_CEPH'): + Logs.info("building ceph vfs modules") + else: + if Options.options.with_cephfs == False: + Logs.info("not building ceph vfs modules(--disable-cephfs)") + elif Options.options.with_cephfs == True: + Logs.error("acl support disabled or ceph_statx/ceph_openat not " + "available, cannot build ceph vfs modules") + conf.fatal("acl support disabled or ceph_statx/ceph_openat not " + "available, but --enable-cephfs was specified") else: - Logs.warn('''Ceph support disabled due to --without-acl-support - or lack of ceph_statx/ceph_openat support''') - conf.undefine('HAVE_CEPH') + Logs.warn("acl support disabled or ceph_statx/ceph_openat not " + "available, not building ceph vfs modules") if Options.options.with_glusterfs: conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 4" --cflags --libs',