diff options
| author | Alan Conway <aconway@apache.org> | 2008-02-06 20:49:05 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-02-06 20:49:05 +0000 |
| commit | 790a3ac50987c7e87ec501e1fa2438faa162ab69 (patch) | |
| tree | a1f697d838a927df34c51213c2c38d39d4eefb96 /cpp | |
| parent | a53459d9f89b67d10e2276f58c515c63ea333244 (diff) | |
| download | qpid-python-790a3ac50987c7e87ec501e1fa2438faa162ab69.tar.gz | |
Replaced --enable-cluster option with --with-cpg to enable/disable CPG.
make rpmbuild uses --with-cpg, will fail unless openais is installed.
Normal builds respect explicit --with/--without, or use CPG if
installed when neither is specified.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@619148 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/configure.ac | 46 | ||||
| -rw-r--r-- | cpp/qpidc.spec.in | 6 | ||||
| -rw-r--r-- | cpp/src/cluster.mk | 2 | ||||
| -rw-r--r-- | cpp/src/tests/cluster.mk | 2 |
4 files changed, 30 insertions, 26 deletions
diff --git a/cpp/configure.ac b/cpp/configure.ac index dcdb1d5616..3d68ed7890 100644 --- a/cpp/configure.ac +++ b/cpp/configure.ac @@ -138,29 +138,33 @@ AC_SUBST(DOWNLOAD_URL) AC_CHECK_HEADERS([boost/shared_ptr.hpp uuid/uuid.h],, AC_MSG_ERROR([Missing required header files.])) -# Check for cluster requirements. -save_ldflags=$LDFLAGS +# Check for optional CPG requirement. +save_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais" -AC_CHECK_LIB([cpg],[cpg_initialize],[cpg_lib=yes],[cpg_lib=no]) -AC_CHECK_HEADER([openais/cpg.h],[cpg_h=yes]) -test x$cpg_lib = xyes -a x$cpg_h = xyes && enable_CLUSTER=yes - -if test x$enable_CLUSTER = xyes; then - AC_ARG_ENABLE([cluster], - [AS_HELP_STRING([--disable-cluster], - [disable cluster functionality (default enabled)])], - [enable_CLUSTER=$enableval]) -fi -AM_CONDITIONAL([CLUSTER], [test x$enable_CLUSTER = xyes]) -if test x$enable_CLUSTER = xyes; then - CPPFLAGS+=" -DCLUSTER" - SPEC_REQUIRES_OPENAIS="Requires: openais" - AC_SUBST(SPEC_REQUIRES_OPENAIS) - SPEC_REQUIRES_OPENAIS_DEVEL="Requires: openais-devel" - AC_SUBST(SPEC_REQUIRES_OPENAIS_DEVEL) + +AC_ARG_WITH([cpg], + [AS_HELP_STRING([--with-cpg], [Build with CPG support])], + [case "${withval}" in + yes) # yes - enable + with_CPG=yes + AC_CHECK_LIB([cpg],[cpg_initialize],,[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])]) + ;; + no) # no -disable + with_CPG=no + ;; + *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;; + esac], + [ # not specified - enable if libs/headers available. + with_CPG=yes + AC_CHECK_LIB([cpg],[cpg_initialize],,[with_CPG=no]) + AC_CHECK_HEADERS([openais/cpg.h],,[with_CPG=no]) + ] +) +AM_CONDITIONAL([CPG], [test x$with_CPG = xyes]) +if test x$with_CPG = xyes; then + CPPFLAGS+=" -DCPG" else - SPEC_CONFIGURE_OPTS=--disable-cluster - AC_SUBST(SPEC_CONFIGURE_OPTS) LDFLAGS=$save_ldflags fi diff --git a/cpp/qpidc.spec.in b/cpp/qpidc.spec.in index 5262bfb4b2..04cc5cc8e7 100644 --- a/cpp/qpidc.spec.in +++ b/cpp/qpidc.spec.in @@ -52,7 +52,7 @@ in C++ using Qpid. Qpid implements the AMQP messaging specification. Summary: An AMQP message broker daemon Group: System Environment/Daemons Requires: %name = %version-%release -@SPEC_REQUIRES_OPENAIS@ +Requires: openais %description -n %{qpidd} A message broker daemon that receives stores and routes messages using @@ -63,7 +63,7 @@ Summary: Libraries and header files for developing Qpid broker extensions Group: Development/System Requires: %name-devel = %version-%release Requires: %{qpidd} = %version-%release -@SPEC_REQUIRES_OPENAIS_DEVEL@ +Requires: openais-devel %description -n %{qpidd}-devel Libraries and header files for developing extensions to the @@ -73,7 +73,7 @@ Qpid broker daemon. %setup -q %build -%configure --disable-static @SPEC_CONFIGURE_OPTS@ CXXFLAGS="-O3 -DNDEBUG" +%configure --disable-static --with-cpg CXXFLAGS="-O3 -DNDEBUG" make %{?_smp_mflags} # Remove this generated perl file, we don't need it and it upsets rpmlint. rm docs/api/html/installdox diff --git a/cpp/src/cluster.mk b/cpp/src/cluster.mk index 0c3e4af20f..9503845b92 100644 --- a/cpp/src/cluster.mk +++ b/cpp/src/cluster.mk @@ -3,7 +3,7 @@ # lib_LTLIBRARIES += libqpidcluster.la -if CLUSTER +if CPG libqpidcluster_la_SOURCES = \ qpid/cluster/Cluster.cpp \ diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk index 3db0604e2c..ba8d99935f 100644 --- a/cpp/src/tests/cluster.mk +++ b/cpp/src/tests/cluster.mk @@ -1,4 +1,4 @@ -if CLUSTER +if CPG # # Cluster tests makefile fragment, to be included in Makefile.am # |
