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 )
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
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;
mf->mclose = mib_close;
return mib_open(name,mf,0);
+
+#else
+ (void) name;
+ (void) mf;
+ errno = ENOSYS;
+ return -1;
+#endif
}