[ofa-general] ***SPAM*** [PATCH] opensm/osm_config.h: generated OSM_DEBUG macro

Sasha Khapyorsky sashak at voltaire.com
Sat Oct 11 04:23:19 PDT 2008


In accordance with requested mode ./configure will generate OSM_DEBUG
macro in files config.h and osm_config.h. This will be defined as '1'
when debug mode was enabled and undefined otherwise. It can be used by
third parties (such as ibutils and plugins) to know about OpenSM build
mode.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/configure.in                   |    3 +++
 opensm/include/opensm/osm_config.h.in |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/opensm/configure.in b/opensm/configure.in
index 680e6a0..bf24fcd 100644
--- a/opensm/configure.in
+++ b/opensm/configure.in
@@ -71,6 +71,9 @@ AC_ARG_ENABLE(debug,    [  --enable-debug          Turn on debugging],
 	no)  debug=false ;;
 	*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
 esac],debug=false)
+if test x$debug = xtrue ; then
+	AC_DEFINE(OSM_DEBUG, 1, [ define 1 if OpenSM build is in a debug mode ])
+fi
 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
 
 AC_ARG_ENABLE(libcheck, [  --disable-libcheck      do not test for presence of ib libraries],
diff --git a/opensm/include/opensm/osm_config.h.in b/opensm/include/opensm/osm_config.h.in
index 6781af7..b12006f 100644
--- a/opensm/include/opensm/osm_config.h.in
+++ b/opensm/include/opensm/osm_config.h.in
@@ -10,6 +10,9 @@
 #ifndef _OSM_CONFIG_H_
 #define _OSM_CONFIG_H_
 
+/* define 1 if OpenSM build is in a debug mode */
+#undef OSM_DEBUG
+
 /* Define as 1 if you want Dual Sided RMPP Support */
 #undef DUAL_SIDED_RMPP
 
-- 
1.6.0.1.196.g01914




More information about the general mailing list