summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/configure.ac20
-rw-r--r--ctdb/utils/pmda/config.m432
2 files changed, 33 insertions, 19 deletions
diff --git a/ctdb/configure.ac b/ctdb/configure.ac
index 85934a72b0d..37b5a6402ff 100644
--- a/ctdb/configure.ac
+++ b/ctdb/configure.ac
@@ -94,16 +94,9 @@ m4_include(ib/config.m4)
m4_include(lib/util/signal.m4)
m4_include(lib/util/fault.m4)
m4_include(lib/socket_wrapper/config.m4)
+m4_include(utils/pmda/config.m4)
AC_CHECK_HEADERS(sched.h)
-AC_CHECK_HEADERS(pcp/pmapi.h pcp/impl.h pcp/pmda.h, [], [],
-[[#ifdef HAVE_PCP_PMAPI_H
-# include <pcp/pmapi.h>
-#endif
-#ifdef HAVE_PCP_IMPL_H
-# include <pcp/impl.h>
-#endif
-]])
AC_CHECK_DECL([ETIME], [],[AC_DEFINE([ETIME], ETIMEDOUT, [ETIME on non-supporting platforms])], [
#include <errno.h>
@@ -122,20 +115,9 @@ if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
fi
-if test x"$ac_cv_header_pcp_pmda_h" = x"yes"; then
- CTDB_PMDA=bin/pmdactdb
- CTDB_PMDA_INSTALL=install_pmda
-else
- CTDB_PMDA=
- CTDB_PMDA_INSTALL=
-fi
-
-
AC_SUBST(EXTRA_OBJ)
AC_SUBST(CTDB_SYSTEM_OBJ)
AC_SUBST(CTDB_SCSI_IO)
AC_SUBST(CTDB_PCAP_LDFLAGS)
-AC_SUBST(CTDB_PMDA)
-AC_SUBST(CTDB_PMDA_INSTALL)
AC_OUTPUT(Makefile ctdb.pc)
diff --git a/ctdb/utils/pmda/config.m4 b/ctdb/utils/pmda/config.m4
new file mode 100644
index 00000000000..6b3fbb0ea14
--- /dev/null
+++ b/ctdb/utils/pmda/config.m4
@@ -0,0 +1,32 @@
+AC_ARG_ENABLE(pmda,
+AS_HELP_STRING([--enable-pmda], [Turn on PCP pmda support (default=no)]))
+
+HAVE_PMDA=no
+
+if eval "test x$enable_pmda = xyes"; then
+ HAVE_PMDA=yes
+
+ AC_CHECK_HEADERS(pcp/pmapi.h pcp/impl.h pcp/pmda.h, [],
+ [AC_MSG_ERROR([Missing PCP pmda headers])],
+ [[#ifdef HAVE_PCP_PMAPI_H
+ # include <pcp/pmapi.h>
+ #endif
+ #ifdef HAVE_PCP_IMPL_H
+ # include <pcp/impl.h>
+ #endif
+ #ifdef HAVE_PCP_PMDA_H
+ # include <pcp/pmda.h>
+ #endif
+ ]])
+fi
+
+if test x"$HAVE_PMDA" = x"yes"; then
+ CTDB_PMDA=bin/pmdactdb
+ CTDB_PMDA_INSTALL=install_pmda
+else
+ CTDB_PMDA=
+ CTDB_PMDA_INSTALL=
+fi
+
+AC_SUBST(CTDB_PMDA)
+AC_SUBST(CTDB_PMDA_INSTALL)