ctdb/build: link ctdb_mutex_ceph_rados_helper against ceph-common
authorDavid Disseldorp <ddiss@samba.org>
Mon, 9 Jul 2018 12:53:00 +0000 (14:53 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 21 Aug 2018 09:47:25 +0000 (11:47 +0200)
ceph-common linkage is needed with new versions of Ceph.
Also respect the --libcephfs_dir=<path> parameter when provided.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit bd64af6b8861f892e6ae2840a493f037d1e0a06c)

ctdb/wscript

index 9536eca33dfecf56d7bd2bba7ae913bb7dde62c7..fdd8c6f37f9e0ca3f762817182f62f08860339b0 100644 (file)
@@ -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}')