]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
build: toggle vfs_snapper using --with-shared-modules
authorDavid Disseldorp <ddiss@samba.org>
Wed, 2 Sep 2020 08:50:04 +0000 (10:50 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Wed, 2 Sep 2020 16:24:50 +0000 (16:24 +0000)
7ae03a19b3c ("build: add configure option to control vfs_snapper build")
added new --enable-snapper and --disable-snapper configure parameters to
control whether the vfs_snapper module was built.
The new parameters conflicted with existing
--with-shared-modules=[!]vfs_snapper behaviour.

This change reinstates working --with-shared-modules=[!]vfs_snapper
functionality. vfs_snapper stays enabled by default, but only on Linux.
Linux systems lacking the dbus library and header files should
explicitly disable the module via --with-shared-modules=!vfs_snapper as
documented.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14437

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Sep  2 16:24:50 UTC 2020 on sn-devel-184

source3/wscript

index 5e94c6f6c716a32e1eb2a3973002a4b2fbea8307..335cfd797f1b0bcd67181886e2479cbe0414a492 100644 (file)
@@ -95,7 +95,6 @@ def options(opt):
 
     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('snapper', with_name="enable", without_name="disable", default=True)
 
     opt.add_option('--enable-vxfs',
                   help=("enable support for VxFS (default=no)"),
@@ -1774,17 +1773,6 @@ main() {
     if Options.options.enable_vxfs:
         conf.DEFINE('HAVE_VXFS', '1')
 
-    if Options.options.with_snapper:
-        if conf.CHECK_CFG(package='dbus-1', args='--cflags --libs',
-                      msg='Checking for dbus', uselib_store="DBUS-1"):
-            if (conf.CHECK_HEADERS('dbus/dbus.h', lib='dbus-1')
-                                      and conf.CHECK_LIB('dbus-1', shlib=True)):
-                conf.DEFINE('HAVE_DBUS', '1')
-        else:
-            conf.fatal("vfs_snapper is enabled but prerequisite DBUS libraries "
-                       "or headers not found. Use --disable-snapper to disable "
-                       "vfs_snapper support.");
-
     if conf.CHECK_CFG(package='liburing', args='--cflags --libs',
                       msg='Checking for liburing package', uselib_store="URING"):
         if (conf.CHECK_HEADERS('liburing.h', lib='uring')
@@ -1954,6 +1942,9 @@ main() {
                                       vfs_commit vfs_worm vfs_crossrename vfs_linux_xfs_sgid
                                       vfs_time_audit vfs_offline vfs_virusfilter vfs_widelinks
                                   '''))
+    if host_os.rfind('linux') > -1:
+        default_shared_modules.extend(['vfs_snapper'])
+
     default_shared_modules.extend(TO_LIST('idmap_tdb2 idmap_script'))
     # these have broken dependencies
     forced_shared_modules.extend(TO_LIST('idmap_autorid idmap_rid idmap_hash'))
@@ -2023,9 +2014,6 @@ main() {
     if conf.CONFIG_SET('HAVE_VXFS'):
         default_shared_modules.extend(TO_LIST('vfs_vxfs'))
 
-    if conf.CONFIG_SET('HAVE_DBUS'):
-        default_shared_modules.extend(TO_LIST('vfs_snapper'))
-
     explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',')
     explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',')
 
@@ -2146,4 +2134,13 @@ main() {
         Logs.info("%s: %s" % (static_env, ','.join(conf.env[static_env])))
         Logs.info("%s: %s" % (shared_env, ','.join(conf.env[shared_env])))
 
+    if (('vfs_snapper' in shared_list.get('vfs', []) or 'vfs_snapper' in static_list.get('vfs', []))
+        and not (conf.CHECK_CFG(package='dbus-1', args='--cflags --libs',
+                                msg='Checking for dbus', uselib_store="DBUS-1")
+                 and conf.CHECK_HEADERS('dbus/dbus.h', lib='dbus-1')
+                 and conf.CHECK_LIB('dbus-1', shlib=True))):
+        conf.fatal("vfs_snapper is enabled but prerequisite dbus-1 package not "
+                   "found. Use --with-shared-modules=!vfs_snapper to disable "
+                   "vfs_snapper support.")
+
     conf.SAMBA_CONFIG_H('include/config.h')