diff mbox series

[rdma-core,02/20] ibdiags: Add required definitions to rdma-core config.h

Message ID 20190514234936.5175-3-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show
Series Incorporate infiniband-diags into rdma-core | expand

Commit Message

Jason Gunthorpe May 14, 2019, 11:49 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 CMakeLists.txt              | 2 ++
 buildlib/config.h.in        | 4 ++++
 ibdiags/src/ibdiag_common.c | 5 ++---
 3 files changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31100e267f2150..5cb3c32c318821 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,8 @@  set(BUILD_STATIC_LIB ${CMAKE_BINARY_DIR}/lib/statics)
 set(BUILD_ETC ${CMAKE_BINARY_DIR}/etc)
 set(BUILD_PYTHON ${CMAKE_BINARY_DIR}/python)
 
+set(IBDIAG_CONFIG_PATH "${CMAKE_INSTALL_FULL_SYSCONFDIR}/infiniband-diags")
+
 set(CMAKE_INSTALL_INITDDIR "${CMAKE_INSTALL_SYSCONFDIR}/init.d"
   CACHE PATH "Location for init.d files")
 set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index 0754d249423476..b4cb669b7be4bf 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -7,6 +7,8 @@ 
 #define HAVE_ISBLANK 1
 #define HAVE_BUILTIN_CLZL 1
 
+#define PACKAGE_VERSION "@PACKAGE_VERSION@"
+
 // FIXME: Remove this, The cmake version hard-requires new style CLOEXEC support
 #define STREAM_CLOEXEC "e"
 
@@ -29,6 +31,8 @@ 
 #define IBACM_IBACME_SERVER_PATH "@CMAKE_INSTALL_FULL_RUNDIR@/" IBACM_SERVER_BASE
 #define IBACM_SERVER_PATH "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.sock"
 
+#define IBDIAG_CONFIG_PATH "@IBDIAG_CONFIG_PATH@"
+
 #define VERBS_PROVIDER_DIR "@VERBS_PROVIDER_DIR@"
 #define VERBS_PROVIDER_SUFFIX "@IBVERBS_PROVIDER_SUFFIX@"
 #define IBVERBS_PABI_VERSION @IBVERBS_PABI_VERSION@
diff --git a/ibdiags/src/ibdiag_common.c b/ibdiags/src/ibdiag_common.c
index 293b9afce0a021..a5056ad244c7c3 100644
--- a/ibdiags/src/ibdiag_common.c
+++ b/ibdiags/src/ibdiag_common.c
@@ -58,7 +58,6 @@ 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
 #include <ibdiag_common.h>
-#include <ibdiag_version.h>
 
 int ibverbose;
 enum MAD_DEST ibd_dest_type = IB_DEST_LID;
@@ -84,8 +83,8 @@  static const struct ibdiag_opt *opts_map[256];
 
 static const char *get_build_version(void)
 {
-	return "BUILD VERSION: " IBDIAG_VERSION " Build date: " __DATE__ " "
-	    __TIME__;
+	return "BUILD VERSION: " PACKAGE_VERSION " Build date: " __DATE__
+	       " " __TIME__;
 }
 
 static void pretty_print(int start, int width, const char *str)