]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
Added configure --disable-inband to eliminate infiniband/mad.h dependency
authorOren Kladnitsky <orenk@dev.mellanox.co.il>
Thu, 9 Jan 2014 11:17:15 +0000 (13:17 +0200)
committerOren Kladnitsky <orenk@dev.mellanox.co.il>
Tue, 14 Jan 2014 10:06:33 +0000 (12:06 +0200)
This is required to build on eth only platforms.

configure.ac
mtcr_ul/Makefile.am
mtcr_ul/mtcr_ul.c

index a5441e38d1dc7336f55a2979c5e860faef84c82d..0c7d2b57ca2384668178ed6f44b412bfed052de9 100644 (file)
@@ -20,21 +20,34 @@ AC_CONFIG_HEADERS( config.h )
 
 AC_MSG_CHECKING(--enable-dc argument)
 AC_ARG_ENABLE(dc,
-                   [  --disable-dc            Disable mstflint "dc" command. Eliminate zlib dependency],
+                   [  --disable-dc            Disable mstflint "dc" command. Eliminates zlib dependency],
                    [enable_dc=$enableval],
                    [enable_dc="yes"])
-AC_MSG_RESULT($enableval)
+AC_MSG_RESULT($enable_dc)
 if test "$enable_dc" = "yes"; then
   AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR([cannot find zlib.h . Use --disable-dc to remove this dependaency]))
   AC_CHECK_LIB(z, uncompress,, AC_MSG_ERROR([cannot find zlib uncompress() function. Use --disable-dc to remove this dependaency]))
   mstflint_LIBS="-lz"
 else
-  mstflint_CXXFLAGS="-DNO_ZLIB"  
+  mstflint_CXXFLAGS="-DNO_ZLIB"
 fi
+
 AC_SUBST(mstflint_LIBS)
 AC_SUBST(mstflint_CXXFLAGS)
 
+AC_MSG_CHECKING(--enable-inband argument)
+AC_ARG_ENABLE(inband,
+                   [  --disable-inband        Disable inabnd access. Prevents FW updtes for Mellanox SwitchX and ConnectIB devices. Eliminates infiniband/mad.h dependency],
+                   [enable_inband=$enableval],
+                   [enable_inband="yes"])
+AC_MSG_RESULT($enable_inband)
+if test "x$enable_inband" = "xyes"; then
+  AC_CHECK_HEADER(infiniband/mad.h,,AC_MSG_ERROR([cannot find infiniband/mad.h . Use --disable-inband to remove this dependaency]))
+fi
+
+AM_CONDITIONAL(ENABLE_INBAND, [test  "x$enable_inband" = "xyes"])
+
 AC_CONFIG_FILES( mstflint.spec )
 
 AC_OUTPUT( Makefile mtcr_ul/Makefile dev_mgt/Makefile mflash/Makefile tools_layouts/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
-               small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile  mstdump/mstdump_dbs/Makefile ) 
+               small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile  mstdump/mstdump_dbs/Makefile )
index 6229e922f020e07c62ad8575d8a0041a3d725624..3d039d5908927c4ef477cd7449a3c3754272fa3f 100644 (file)
@@ -35,9 +35,15 @@ INCLUDES = -I$(top_srcdir)/include/mtcr_ul
 
 lib_LIBRARIES = libmtcr_ul.a
 
-libmtcr_ul_a_SOURCES = mtcr_ul.c mtcr_ib_ofed.c mtcr_ib.h  mtcr_int_defs.h
-
+libmtcr_ul_a_SOURCES = mtcr_ul.c mtcr_ib.h  mtcr_int_defs.h
 libmtcr_ul_a_CFLAGS = -W -Wall -g -MP -MD -fPIC -DMTCR_API="" -DMST_UL
+
+if ENABLE_INBAND
+libmtcr_ul_a_SOURCES += mtcr_ib_ofed.c
+else
+libmtcr_ul_a_CFLAGS += -DNO_INBAND
+endif
+
 libraryincludedir=$(includedir)/mtcr_ul
 libraryinclude_HEADERS = $(top_srcdir)/include/mtcr_ul/mtcr.h
 
index 884614e5136a1f6131d49cfff74dec731f845cfc..5c4f6f23b0d668ae1bf853ae6b1ee120779673a8 100644 (file)
@@ -636,8 +636,9 @@ int mtcr_pciconf_open(mfile *mf, const char *name)
 static
 int mtcr_inband_open(mfile* mf, const char* name)
 {
-    mf->access_type   = MTCR_ACCESS_INBAND;
 
+#ifndef NO_INBAND
+    mf->access_type   = MTCR_ACCESS_INBAND;
     mf->mread4        = mib_read4;
     mf->mwrite4       = mib_write4;
     mf->mread4_block  = mib_readblock;
@@ -646,6 +647,13 @@ int mtcr_inband_open(mfile* mf, const char* name)
     mf->mclose        = mib_close;
 
     return mib_open(name,mf,0);
+
+#else
+    (void) name;
+    (void) mf;
+    errno = ENOSYS;
+    return -1;
+#endif
 }