[ofa-general] [PATCH] infiniband-diags: use common build version

Sasha Khapyorsky sashak at voltaire.com
Sun Jan 6 17:57:37 PST 2008


Use common version (as defined in configure.in) instead of per tool
__BUILD_VERSION_TAG__.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 infiniband-diags/configure.in                |    1 +
 infiniband-diags/include/ibdiag_common.h     |    8 +----
 infiniband-diags/include/ibdiag_version.h.in |   39 ++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 6 deletions(-)
 create mode 100644 infiniband-diags/include/ibdiag_version.h.in

diff --git a/infiniband-diags/configure.in b/infiniband-diags/configure.in
index 1d5810a..1baa6cb 100644
--- a/infiniband-diags/configure.in
+++ b/infiniband-diags/configure.in
@@ -136,6 +136,7 @@ AC_SUBST(IBSCRIPTPATH)
 AC_CONFIG_FILES([\
         Makefile \
         infiniband-diags.spec \
+        include/ibdiag_version.h \
         scripts/ibcheckerrors \
         scripts/ibcheckerrs \
         scripts/ibchecknet \
diff --git a/infiniband-diags/include/ibdiag_common.h b/infiniband-diags/include/ibdiag_common.h
index 029d80e..e8b1fab 100644
--- a/infiniband-diags/include/ibdiag_common.h
+++ b/infiniband-diags/include/ibdiag_common.h
@@ -52,15 +52,11 @@ extern int   ibdebug;
 
 void  iberror(const char *fn, char *msg, ...);
 
-#ifdef __BUILD_VERSION_TAG__
-
-#define stringify(s) to_string(s)
-#define to_string(s) #s
+#include <ibdiag_version.h>
 
 static inline const char* get_build_version(void)
 {
-	return "BUILD VERSION: " stringify(__BUILD_VERSION_TAG__) " Build date: " __DATE__ " " __TIME__ ;
+	return "BUILD VERSION: " IBDIAG_VERSION " Build date: " __DATE__ " " __TIME__ ;
 }
-#endif
 
 #endif	/* _IBDIAG_COMMON_H_ */
diff --git a/infiniband-diags/include/ibdiag_version.h.in b/infiniband-diags/include/ibdiag_version.h.in
new file mode 100644
index 0000000..62430c5
--- /dev/null
+++ b/infiniband-diags/include/ibdiag_version.h.in
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2008 Voltaire Inc.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _IBDIAG_VERSION_H_
+#define _IBDIAG_VERSION_H_
+
+#define IBDIAG_VERSION "@VERSION@"
+
+#endif	/* _IBDIAG_VERSION_H_ */
-- 
1.5.4.rc2.38.gd6da3




More information about the general mailing list