From be3247adde27ec5bc68d8b2ec669a94378bb1c5a Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Wed, 2 Sep 2020 10:50:04 +0200 Subject: [PATCH] build: toggle vfs_snapper using --with-shared-modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Björn Jacke Autobuild-User(master): David Disseldorp Autobuild-Date(master): Wed Sep 2 16:24:50 UTC 2020 on sn-devel-184 (cherry picked from commit b6805d5e0bcf1716f87e84bcbb2fd8f93c38a8a3) --- source3/wscript | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/source3/wscript b/source3/wscript index 5e94c6f6c71..335cfd797f1 100644 --- a/source3/wscript +++ b/source3/wscript @@ -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') -- 2.26.2