On 01/10/2013 01:18 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 78 ++----------------------------------------------------
m4/virt-sanlock.m4 | 38 ++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 76 deletions(-)
create mode 100644 m4/virt-sanlock.m4
+++ b/m4/virt-sanlock.m4
@@ -0,0 +1,38 @@
+dnl The libsanlock_client.so library
+
+AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[
+ LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client], [sanlock_init], [sanlock.h])
+
It might be worth making the rest of this macro conditional:
if test "x$with_sanlock" != "xno" ; then
+ AC_CHECK_DECLS([SANLK_INQ_WAIT], [sanlock_inq_wait=1],
[sanlock_inq_wait=0], [[
+ #include <stdint.h>
+ #include <sanlock_admin.h>
+ ]])
+
+
+ old_cppflags="$CPPFLAGS"
+ old_libs="$LIBS"
+ CPPFLAGS="$CPPFLAGS $SANLOCK_CFLAGS"
+ LIBS="$LIBS $SANLOCK_LIBS"
+
+ AC_CHECK_LIB([sanlock_client], [sanlock_killpath],
+ [sanlock_killpath=yes], [sanlock_killpath=no])
That is, no need to waste time checking for a library function if we
already know we aren't going to use the library.
+ if test "x$sanlock_killpath" = "xyes" ; then
+ AC_DEFINE_UNQUOTED([HAVE_SANLOCK_KILLPATH], 1,
+ [whether Sanlock supports sanlock_killpath])
+ fi
+
+ AC_CHECK_LIB([sanlock_client], [sanlock_inq_lockspace],
+ [sanlock_inq_lockspace=yes], [sanlock_inq_lockspace=no])
+ if test "x$sanlock_inq_lockspace" = "xyes" && \
+ test $sanlock_inq_wait = 1; then
+ AC_DEFINE_UNQUOTED([HAVE_SANLOCK_INQ_LOCKSPACE], 1,
+ [whether sanlock supports sanlock_inq_lockspace])
+ fi
+
+ CPPFLAGS="$old_cppflags"
+ LIBS="$old_libs"
fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_SANLOCK],[
+ LIBVIRT_RESULT_LIB([SANLOCK])
+])
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org