From: David Disseldorp Date: Mon, 9 Jul 2018 12:53:00 +0000 (+0200) Subject: ctdb/build: link ctdb_mutex_ceph_rados_helper against ceph-common X-Git-Tag: samba-4.7.10~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a18bcf23a265b71fa88e1963ea23dfd26beaaec3;p=thirdparty%2Fsamba.git ctdb/build: link ctdb_mutex_ceph_rados_helper against ceph-common ceph-common linkage is needed with new versions of Ceph. Also respect the --libcephfs_dir= parameter when provided. Signed-off-by: David Disseldorp Reviewed-by: Amitay Isaacs (cherry picked from commit bd64af6b8861f892e6ae2840a493f037d1e0a06c) --- diff --git a/ctdb/wscript b/ctdb/wscript index 9536eca33df..fdd8c6f37f9 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -83,6 +83,10 @@ def set_options(opt): opt.add_option('--enable-etcd-reclock', help=("Enable etcd recovery lock helper (default=no)"), action="store_true", dest='ctdb_etcd_reclock', default=False) + + opt.add_option('--with-libcephfs', + help=("Directory under which libcephfs is installed"), + action="store", dest='libcephfs_dir', default=None) opt.add_option('--enable-ceph-reclock', help=("Enable Ceph CTDB recovery lock helper (default=no)"), action="store_true", dest='ctdb_ceph_reclock', default=False) @@ -210,8 +214,16 @@ def configure(conf): conf.env.etcd_reclock = have_etcd_reclock if Options.options.ctdb_ceph_reclock: + # Use custom libcephfs library path if provided. XXX The top level build + # explicitly sets LIBPATH_CEPH-COMMON when libcephfs_dir isn't provided. + if Options.options.libcephfs_dir: + conf.env['CPPPATH_RADOS'] = Options.options.libcephfs_dir + '/include' + conf.env['LIBPATH_RADOS'] = Options.options.libcephfs_dir + '/lib' + conf.env['LIBPATH_CEPH-COMMON'] = conf.env['LIBPATH_RADOS'] + '/ceph' + if (conf.CHECK_HEADERS('rados/librados.h', False, False, 'rados') and conf.CHECK_LIB('rados', shlib=True)): + conf.CHECK_LIB('ceph-common', shlib=True) Logs.info('Building with Ceph librados recovery lock support') conf.define('HAVE_LIBRADOS', 1) else: @@ -574,7 +586,7 @@ def build(bld): if bld.env.HAVE_LIBRADOS: bld.SAMBA_BINARY('ctdb_mutex_ceph_rados_helper', source='utils/ceph/ctdb_mutex_ceph_rados_helper.c', - deps='talloc tevent rados', + deps='talloc tevent rados ceph-common', includes='include', install_path='${CTDB_HELPER_BINDIR}')