Topics

[PATCH] BUILD: configure should fail by default with no bridge


Michael Schonberg <mschonberg@...>
 

From: Mike Schonberg <mikeschonberg@nyx.com>

Although it should be possible to build without a messaging or payload bridge,
this is not normally the desired result. To follow the principal of least
astonishment, configure for MAMA should fail if it fails to find a middleware or
payload bridge, unless passed parameters explicitly requesting a build without
them.

Add --without-middleware-bridge and --without-payload-bridge arguments to
configure.ac for MAMA. Tested the following permutations:

--with-avis | --without-payload-bridge | --without-middleware-bridge | result
-------------------------------------------------------------------------------
Y | N | N | pass
Y | Y | N | fail
Y | N | Y | fail
Y | Y | Y | fail
N | Y | Y | pass
N | Y | N | fail
N | N | Y | fail
N | N | N | fail

Signed-off-by: Michael Schonberg <mschonberg@nyx.com>
---
mama/c_cpp/configure.ac | 52 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/mama/c_cpp/configure.ac b/mama/c_cpp/configure.ac
index 1bae611..d081d30 100644
--- a/mama/c_cpp/configure.ac
+++ b/mama/c_cpp/configure.ac
@@ -47,6 +47,10 @@ AC_PROG_CXX
AC_PROG_LEX
AC_PROG_CC

+# make sure that we configure bridges or specifically build without them
+mwbridge=false
+payloadbridge=false
+
# Check whether to use built-in library archiver if C++ compiler is Sun/Forte
if CXXbase=`echo ${CXX} | ${ac_cv_prog_AWK} '{ print $1; }'` ; \
test "x${build_vendor}" = "xsun" -a "x`basename ${CXXbase}`" = "xCC"
@@ -199,6 +203,9 @@ AC_ARG_WITH(
LDFLAGS="$LDFLAGS -L$AVIS_HOME/lib"
with_avis=true
mama_platform=avis
+ mama_payload=avis
+ mwbridge=true
+ payloadbridge=true
],
[
AC_MSG_ERROR([Valid Avis installation not found! You may need to copy avis_client_config.h from platforms/gnu_auotmake to $AVIS_HOME/include/avis)])
@@ -272,6 +279,51 @@ AC_ARG_WITH(
AM_CONDITIONAL(WITH_TESTTOOLS, test x$with_testtools = xtrue)

##################################################
+# NO BRIDGES: --no-middleware-bridge --no-payload-bridge
+#
+# If we get here and the build is not configured for a bridge we need to ensure
+# that we really want to build without them.
+#
+##################################################
+
+# --without-middleware-bridge
+AC_ARG_WITH([middleware-bridge],
+ [AS_HELP_STRING([--without-middleware-bridge],
+ [Build OpenMAMA with no middleware bridge.])],
+ [],
+ [with_middleware_bridge=yes])
+
+# --without-payload-bridge
+AC_ARG_WITH([payload-bridge],
+ [AS_HELP_STRING([--without-payload-bridge],
+ [Build OpenMAMA with no payload bridge.])],
+ [],
+ [with_payload_bridge=yes])
+
+
+# Trying to build without a message bridge but --without-middleware-bridge
+# not specified
+if test x${mwbridge} = xfalse -a x$with_middleware_bridge = xyes; then
+ AC_MSG_ERROR([No middleware bridge specified! If this is intentional specify --without-middleware-bridge])
+fi
+
+# Trying bo build without a middleware bridge but bridge specified
+if test x${mwbridge} = xtrue -a x$with_middleware_bridge = xno; then
+ AC_MSG_ERROR([--without-middleware-bridge specified with ${mama_platform}])
+fi
+
+# Trying to build without a payload bridge but --without-payload-bridge
+# not specified
+if test x${payloadbridge} = xfalse -a x$with_payload_bridge = xyes; then
+ AC_MSG_ERROR([No payload bridge specified! If this is intentional specify --without-payload-bridge])
+fi
+
+# Trying bo build without a payload bridge but bridge specified
+if test x${mwbridge} = xtrue -a x$with_payload_bridge = xno; then
+ AC_MSG_ERROR([--without-payload-bridge specified with ${mama_payload}])
+fi
+
+##################################################
#
# VERSION FILE GENERATION
#
--
1.7.5.4