From 75ee14ffbe362c41be096eca9a2fef1ec7e8db94 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 24 Jun 2013 14:34:50 +0200 Subject: build: declare lvm_lv_from_name() if it is missing from lvm2app.h The bd-xlator can not be built successfully on certain Debian distributions due to a missing declaration of lvm_lv_from_name(). This function is available for linking, but it does not exist in the header file. This change adds a detection for lvm_lv_from_name() in both the library for linking, and the declaration in the header file. If the 1st is missing, the bd-xlator can not be built, and if only the 2nd one is missing, we'll declare lvm_lv_from_name() ourselves. This makes it possible to build the bd-xlator on the affected Debian distributions too. Change-Id: I0c823a7861b02bb5d9c1abb76ebfff92f272f9eb BUG: 976946 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/5250 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- configure.ac | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9db3bf935..83d5a4ed9 100644 --- a/configure.ac +++ b/configure.ac @@ -291,9 +291,18 @@ AC_ARG_ENABLE([bd-xlator], if test "x$enable_bd_xlator" != "xno"; then AC_CHECK_LIB([lvm2app], - [lvm_init], + [lvm_init,lvm_lv_from_name], [HAVE_BD_LIB="yes"], [HAVE_BD_LIB="no"]) + + if test "x$HAVE_BD_LIB" = "xyes"; then + # lvm_lv_from_name() has been made public with lvm2-2.02.79 + AC_CHECK_DECLS( + [lvm_lv_from_name], + [NEED_LVM_LV_FROM_NAME_DECL="no"], + [NEED_LVM_LV_FROM_NAME_DECL="yes"], + [[#include ]]) + fi fi if test "x$enable_bd_xlator" = "xyes" -a "x$HAVE_BD_LIB" = "xno"; then @@ -306,6 +315,10 @@ if test "x${enable_bd_xlator}" != "xno" -a "x${HAVE_BD_LIB}" = "xyes"; then BUILD_BD_XLATOR=yes AC_DEFINE(HAVE_BD_XLATOR, 1, [define if lvm2app library found and bd xlator enabled]) + if test "x$NEED_LVM_LV_FROM_NAME_DECL" = "xyes"; then + AC_DEFINE(NEED_LVM_LV_FROM_NAME_DECL, 1, [defined if lvm_lv_from_name() + was not found in the lvm2app.h header, but can be linked]) + fi fi AM_CONDITIONAL([ENABLE_BD_XLATOR], [test x$BUILD_BD_XLATOR = xyes]) -- cgit