]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
source3/wscript: Introduce auto mode to build ceph vfs modules
authorAnoop C S <anoopcs@samba.org>
Mon, 5 Aug 2024 13:21:49 +0000 (18:51 +0530)
committerJule Anger <janger@samba.org>
Thu, 13 Mar 2025 15:31:09 +0000 (15:31 +0000)
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 <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Aug 27 06:18:51 UTC 2024 on atb-devel-224

(cherry picked from commit 232ab02faf9615c55c362c60e06381ea02421794)

source3/wscript

index 2cf537704b2545a6e5df44ac4ec24c94ae0c57fe..f746a67b800833b7d2b5e298f04418173a5ca662 100644 (file)
@@ -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',