diff options
author | Alan Conway <aconway@apache.org> | 2008-12-17 23:44:04 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-12-17 23:44:04 +0000 |
commit | 1e4fd5eaa140f5841d706cd9cf6999688b610c97 (patch) | |
tree | 1797981844bb4dac3a6e32664c31b10a46395d4b /qpid/cpp | |
parent | 2e097cce0c79dd4f8a83a813b31ebc8f5df49368 (diff) | |
download | qpid-python-1e4fd5eaa140f5841d706cd9cf6999688b610c97.tar.gz |
Handle package name changes in Fedora10: openais->corosync cman->cmanlib
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@727583 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r-- | qpid/cpp/INSTALL | 16 | ||||
-rw-r--r-- | qpid/cpp/configure.ac | 40 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/cluster/Cpg.cpp | 5 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/cluster/Cpg.h | 4 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/cluster/types.h | 10 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/ais_check | 4 |
6 files changed, 46 insertions, 33 deletions
diff --git a/qpid/cpp/INSTALL b/qpid/cpp/INSTALL index 317f576f36..1760ae2706 100644 --- a/qpid/cpp/INSTALL +++ b/qpid/cpp/INSTALL @@ -90,13 +90,19 @@ NOTE: make sure to install the related '-devel' packages also! 2.2.1. Using Package Management Tools ===================================== -On linux most packages can be installed using your distribution's package -management tool. For example on Fedora: - # yum install boost-devel e2fsprogs-devel pkgconfig openais openais-devel - # yum install gcc-c++ make autoconf automake help2man libtool doxygen graphviz ruby + +On linux most packages can be installed using your distribution's +package management tool. For example on Fedora: + + # yum install boost-devel e2fsprogs-devel pkgconfig gcc-c++ make autoconf automake ruby libtool help2man doxygen graphviz + +The optional clustering packages changed name in Fedora 10. On Fedora 9 or earlier: + # yum install openais-devel cman-devel +On Fedora 10 or later + # yum install corosync-devel cmanlib-devel Follow the manual installation instruction below for any packages not -available through yum. +available through your distributions packaging tool. 2.2.2. From Source ================== diff --git a/qpid/cpp/configure.ac b/qpid/cpp/configure.ac index 355adafb90..3070ce6687 100644 --- a/qpid/cpp/configure.ac +++ b/qpid/cpp/configure.ac @@ -165,44 +165,44 @@ AC_CHECK_HEADERS([boost/shared_ptr.hpp uuid/uuid.h],, # Check for optional cluster requirements. tmp_LIBS=$LIBS -LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais" +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 - enable - with_CPG=yes - AC_CHECK_LIB([cpg],[cpg_local_get],,[AC_MSG_ERROR([libcpg not found, install openais])]) - AC_CHECK_HEADERS([openais/cpg.h],,[AC_MSG_ERROR([openais/cpg.h not found, install openais-devel])]) + yes) # yes - require dependencies + test x$have_libcpg = xyes || AC_MSG_ERROR([libcpg not found, install openais or corosync]) + 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 ;; + no) with_cpg=no ;; *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;; esac], [ # not specified - use if present - with_CPG=yes - AC_CHECK_LIB([cpg],[cpg_local_get],,[with_CPG=no]) - AC_CHECK_HEADERS([openais/cpg.h],,[with_CPG=no]) + test x$have_libcpg = xyes -a x$have_cpg_h = xyes && with_cpg=yes ] ) -AM_CONDITIONAL([HAVE_LIBCPG], [test x$with_CPG = xyes]) +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 - enable - with_LIBCMAN=yes - AC_CHECK_LIB([cman],[cman_is_quorate],,[AC_MSG_ERROR([libcman not found, install libcman package.])]) - AC_CHECK_HEADERS([libcman.h],,[AC_MSG_ERROR([libcman.h not found, install cman-devel])]) + 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 ;; + no) with_libcman=no ;; *) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;; esac], - [ # not specified - use if present and with_CPG=yes - with_LIBCMAN=$with_CPG - AC_CHECK_LIB([cman],[cman_is_quorate],,with_LIBCMAN=no) - AC_CHECK_HEADERS([libcman.h],,with_LIBCMAN=no) + [ # 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]) +AM_CONDITIONAL([HAVE_LIBCMAN], [test x$with_libcman = xyes]) LIBS=$tmp_LIBS diff --git a/qpid/cpp/src/qpid/cluster/Cpg.cpp b/qpid/cpp/src/qpid/cluster/Cpg.cpp index 0d7b15cfa8..48c3b483f9 100644 --- a/qpid/cpp/src/qpid/cluster/Cpg.cpp +++ b/qpid/cpp/src/qpid/cluster/Cpg.cpp @@ -69,7 +69,10 @@ int Cpg::getFd() { } Cpg::Cpg(Handler& h) : IOHandle(new sys::IOHandlePrivate), handler(h), isShutdown(false) { - cpg_callbacks_t callbacks = { &globalDeliver, &globalConfigChange }; + cpg_callbacks_t callbacks; + ::memset(&callbacks, sizeof(callbacks), 0); + callbacks.cpg_deliver_fn = &globalDeliver; + callbacks.cpg_confchg_fn = &globalConfigChange; check(cpg_initialize(&handle, &callbacks), "Cannot initialize CPG"); check(cpg_context_set(handle, this), "Cannot set CPG context"); // Note: CPG is currently unix-specific. If CPG is ported to diff --git a/qpid/cpp/src/qpid/cluster/Cpg.h b/qpid/cpp/src/qpid/cluster/Cpg.h index 2bd58cea1f..5de2b516d5 100644 --- a/qpid/cpp/src/qpid/cluster/Cpg.h +++ b/qpid/cpp/src/qpid/cluster/Cpg.h @@ -30,10 +30,6 @@ #include <cassert> #include <string.h> -extern "C" { -#include <openais/cpg.h> -} - namespace qpid { namespace cluster { diff --git a/qpid/cpp/src/qpid/cluster/types.h b/qpid/cpp/src/qpid/cluster/types.h index 3ee20c4692..857b19cc8a 100644 --- a/qpid/cpp/src/qpid/cluster/types.h +++ b/qpid/cpp/src/qpid/cluster/types.h @@ -22,8 +22,10 @@ * */ + #include "ClusterLeaveException.h" -#include <qpid/Url.h> +#include "config.h" +#include "qpid/Url.h" #include <utility> #include <iosfwd> @@ -32,7 +34,13 @@ #include <stdint.h> extern "C" { +#ifdef HAVE_OPENAIS_CPG_H #include <openais/cpg.h> +#elif HAVE_COROSYNC_CPG_H +# include <corosync/cpg.h> +#else +# error "No cpg.h header file available" +#endif } namespace qpid { diff --git a/qpid/cpp/src/tests/ais_check b/qpid/cpp/src/tests/ais_check index f35010c9f6..5687110165 100755 --- a/qpid/cpp/src/tests/ais_check +++ b/qpid/cpp/src/tests/ais_check @@ -23,8 +23,8 @@ srcdir=`dirname $0` # Check AIS requirements and run tests if found. id -nG | grep '\<ais\>' >/dev/null || \ NOGROUP="You are not a member of the ais group." -ps -u root | grep aisexec >/dev/null || \ - NOAISEXEC="The aisexec daemon is not running as root" +ps -u root | grep 'aisexec\|corosync' >/dev/null || \ + NOAISEXEC="The aisexec or corosync daemon is not running as root" if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then cat <<EOF |