qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r727583 - in /qpid/trunk/qpid/cpp: INSTALL configure.ac src/qpid/cluster/Cpg.cpp src/qpid/cluster/Cpg.h src/qpid/cluster/types.h src/tests/ais_check
Date Wed, 17 Dec 2008 23:44:04 GMT
Author: aconway
Date: Wed Dec 17 15:44:04 2008
New Revision: 727583

URL: http://svn.apache.org/viewvc?rev=727583&view=rev
Log:
Handle package name changes in Fedora10: openais->corosync cman->cmanlib

Modified:
    qpid/trunk/qpid/cpp/INSTALL
    qpid/trunk/qpid/cpp/configure.ac
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h
    qpid/trunk/qpid/cpp/src/qpid/cluster/types.h
    qpid/trunk/qpid/cpp/src/tests/ais_check

Modified: qpid/trunk/qpid/cpp/INSTALL
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/INSTALL?rev=727583&r1=727582&r2=727583&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/INSTALL (original)
+++ qpid/trunk/qpid/cpp/INSTALL Wed Dec 17 15:44:04 2008
@@ -90,13 +90,19 @@
 
 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
 ==================

Modified: qpid/trunk/qpid/cpp/configure.ac
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/configure.ac?rev=727583&r1=727582&r2=727583&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/configure.ac (original)
+++ qpid/trunk/qpid/cpp/configure.ac Wed Dec 17 15:44:04 2008
@@ -165,44 +165,44 @@
 
 # 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
 

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp?rev=727583&r1=727582&r2=727583&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp Wed Dec 17 15:44:04 2008
@@ -69,7 +69,10 @@
 }
 
 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

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h?rev=727583&r1=727582&r2=727583&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h Wed Dec 17 15:44:04 2008
@@ -30,10 +30,6 @@
 #include <cassert>
 #include <string.h>
 
-extern "C" {
-#include <openais/cpg.h>
-}
-
 namespace qpid {
 namespace cluster {
 

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/types.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/types.h?rev=727583&r1=727582&r2=727583&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/types.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/types.h Wed Dec 17 15:44:04 2008
@@ -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 {

Modified: qpid/trunk/qpid/cpp/src/tests/ais_check
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/ais_check?rev=727583&r1=727582&r2=727583&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/ais_check (original)
+++ qpid/trunk/qpid/cpp/src/tests/ais_check Wed Dec 17 15:44:04 2008
@@ -23,8 +23,8 @@
 # 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



Mime
View raw message