Author: astitcher
Date: 2009-07-30 16:43:35 -0400 (Thu, 30 Jul 2009)
New Revision: 3530
Modified:
store/trunk/cpp/Makefile.am
store/trunk/cpp/configure.ac
store/trunk/cpp/tests/Makefile.am
store/trunk/cpp/tests/cluster/Makefile.am
Log:
Remove checks for cluster libraries not used by store
Added a configure argument to control cluster/store tests
By default enable cluster tests if we find the qpid cluster module
Modified: store/trunk/cpp/Makefile.am
===================================================================
--- store/trunk/cpp/Makefile.am 2009-07-30 20:43:23 UTC (rev 3529)
+++ store/trunk/cpp/Makefile.am 2009-07-30 20:43:35 UTC (rev 3530)
@@ -57,4 +57,5 @@
endif
check-long:
- $(MAKE) -C tests check-long
\ No newline at end of file
+ $(MAKE) -C tests check-long
+
Modified: store/trunk/cpp/configure.ac
===================================================================
--- store/trunk/cpp/configure.ac 2009-07-30 20:43:23 UTC (rev 3529)
+++ store/trunk/cpp/configure.ac 2009-07-30 20:43:35 UTC (rev 3530)
@@ -40,11 +40,19 @@
AC_ARG_ENABLE(warnings,
[ --enable-warnings turn on lots of compiler warnings (recommended)],
[case "${enableval}" in
- yes|no) ;;
+ yes|no) enable_WARNINGS=${enableval};;
*) AC_MSG_ERROR([bad value ${enableval} for warnings option]) ;;
esac],
- [enableval=yes])
+ [enable_WARNINGS=yes])
+AC_ARG_ENABLE(cluster-tests,
+[ --enable-cluster-tests enable cluster tests with persistence],
+[case "${enableval}" in
+ yes|no) enable_CLUSTER_TESTS=${enableval} ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for cluster test option]) ;;
+ esac],
+ [enable_CLUSTER_TESTS=none])
+
# Warnings: Enable as many as possible, keep the code clean. Please
# do not disable warnings or remove -Werror without discussing on
# rhm-users list.
@@ -53,7 +61,7 @@
# -Wunreachable-code -Wpadded -Winline
# -Wshadow - warns about boost headers.
-if test "${enableval}" = yes; then
+if test "$enable_WARNINGS" = yes; then
gl_COMPILER_FLAGS(-Werror)
gl_COMPILER_FLAGS(-pedantic)
gl_COMPILER_FLAGS(-Wall)
@@ -101,6 +109,32 @@
AC_SUBST([QPID_LIBS])
AC_SUBST([QPID_CXXFLAGS])
+# Check for cluster module to see whether to enable cluster tests
+AC_MSG_CHECKING([presence of qpid cluster module])
+found_cluster_so=no
+if test x$with_qpid_checkout != x -a -f $QPID_SRC/.libs/cluster.so ; then
+ found_cluster_so=yes
+elif test -f $QPID_LIB/qpid/daemon/cluster.so ; then
+ found_cluster_so=yes
+fi
+
+case "$enable_CLUSTER_TESTS" in
+ yes)
+ if test $found_cluster_so = no; then
+ AC_MSG_ERROR([didn't find cluster module: can't enable cluster tests])
+ fi ;;
+ no) ;;
+ none)
+ if test $found_cluster_so = yes; then
+ enable_CLUSTER_TESTS=yes
+ else
+ enable_CLUSTER_TESTS=no
+ fi ;;
+ *)
+ AC_MSG_ERROR([bad value $enable_CLUSTER_TESTS for cluster tests]) ;;
+esac
+AC_MSG_RESULT([$enable_CLUSTER_TESTS])
+
# Check for libaio and libaio-devel
libaio_fail=0
AC_CHECK_LIB([aio], [io_setup], ,[libaio_fail=1])
@@ -156,52 +190,11 @@
# If rpmlint is available we'll run it when building RPMs.
AC_CHECK_PROG([RPMLINT], [rpmlint], [rpmlint])
AM_CONDITIONAL([HAS_RPMLINT], [test -n "$RPMLINT"])
-
-# Check for optional cluster requirements.
-tmp_LIBS=$LIBS
-LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync
-L/usr/lib64/corosync"
-AC_CHECK_LIB([cpg],[cpg_local_get],[have_libcpg=yes],)
-AC_CHECK_HEADERS([openais/cpg.h corosync/cpg.h],[have_cpg_h=yes],)
-AC_ARG_WITH([cpg],
- [AS_HELP_STRING([--with-cpg], [Build with CPG support for clustering.])],
- [case "${withval}" in
- yes) # yes - require dependencies
- test x$have_libcpg = xyes || AC_MSG_ERROR([libcpg not found, install openais-devel or
corosync-devel])
- test x$have_cpg_h = xyes || AC_MSG_ERROR([cpg.h not found, install openais-devel or
corosync-devel])
- with_cpg=yes
- ;;
- no) with_cpg=no ;;
- *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;;
- esac],
- [ # not specified - use if present
- test x$have_libcpg = xyes -a x$have_cpg_h = xyes && with_cpg=yes
- ]
-)
-AM_CONDITIONAL([HAVE_LIBCPG], [test x$with_cpg = xyes])
-AC_CHECK_LIB([cman],[cman_is_quorate],have_libcman=yes,)
-AC_CHECK_HEADERS([libcman.h],have_libcman_h=yes,)
-AC_ARG_WITH([libcman],
- [AS_HELP_STRING([--with-libcman], [Integration with libcman quorum service.])],
- [case "${withval}" in
- yes) # yes - require dependencies
- test x$have_libcman = xyes || AC_MSG_ERROR([libcman not found, install cman-devel or
cmanlib-devel])
- test x$have_libcman_h = xyes || AC_MSG_ERROR([libcman.h not found, install cman-devel
or cmanlib-devel])
- with_libcman=yes
- ;;
- no) with_libcman=no ;;
- *) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;;
- esac],
- [ # not specified - use if present and we're using
with_cpg
- test x$have_libcman = xyes -a x$have_libcman_h = xyes -a x$with_cpg = xyes &&
with_libcman=yes
- ]
-)
-AM_CONDITIONAL([HAVE_LIBCMAN], [test x$with_libcman = xyes])
-LIBS=$tmp_LIBS
-
# Also doxygen for documentation...
AC_CHECK_PROG([do_doxygen], [doxygen], [yes])
AM_CONDITIONAL([DOXYGEN], [test x$do_doxygen = xyes])
+AM_CONDITIONAL([DO_CLUSTER_TESTS], [test $enable_CLUSTER_TESTS = yes])
AC_CONFIG_FILES([
Makefile
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-07-30 20:43:23 UTC (rev 3529)
+++ store/trunk/cpp/tests/Makefile.am 2009-07-30 20:43:35 UTC (rev 3530)
@@ -28,7 +28,11 @@
TMP_DATA_DIR=$(abs_srcdir)/tmp_data_dir
+if DO_CLUSTER_TESTS
SUBDIRS = jrnl cluster .
+else
+SUBDIRS = jrnl .
+endif
TESTS = \
SimpleTest \
@@ -93,4 +97,4 @@
$(MAKE) -C jrnl check-long
$(MAKE) -C cluster check-long
$(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
-
\ No newline at end of file
+
Modified: store/trunk/cpp/tests/cluster/Makefile.am
===================================================================
--- store/trunk/cpp/tests/cluster/Makefile.am 2009-07-30 20:43:23 UTC (rev 3529)
+++ store/trunk/cpp/tests/cluster/Makefile.am 2009-07-30 20:43:35 UTC (rev 3530)
@@ -23,8 +23,6 @@
abs_builddir=@abs_builddir@
abs_srcdir=@abs_srcdir@
-if HAVE_LIBCPG
-
AM_CXXFLAGS = $(WARNING_CFLAGS) -pthread -DBOOST_TEST_DYN_LINK
INCLUDES=-I$(top_srcdir)/lib $(QPID_CXXFLAGS)
@@ -58,9 +56,3 @@
check-long:
$(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
-else
-
-check-long:
- @echo "Cluster tests skipped - HAVE_LIBCPG not defined."
-
-endif