Blame config/osmvsel.m4

Packit Service 54dbc3
Packit Service 54dbc3
dnl osmvsel.m4: an autoconf for OpenSM Vendor Selection option
Packit Service 54dbc3
dnl
Packit Service 54dbc3
dnl To use this macro, just do OPENIB_APP_OSMV_SEL.
Packit Service 54dbc3
dnl the new configure option --with-osmv will be defined.
Packit Service 54dbc3
dnl current supported values are: openib(default),sim,gen1
Packit Service 54dbc3
dnl The following variables are defined:
Packit Service 54dbc3
dnl OSMV_LDADD - LDADD additional libs for linking the vendor lib
Packit Service 54dbc3
AC_DEFUN([OPENIB_APP_OSMV_SEL], [
Packit Service 54dbc3
# --- BEGIN OPENIB_APP_OSMV_SEL ---
Packit Service 54dbc3
Packit Service 54dbc3
dnl Define a way for the user to provide the osm vendor type
Packit Service 54dbc3
AC_ARG_WITH(osmv,
Packit Service 54dbc3
    AC_HELP_STRING([--with-osmv=<type>],
Packit Service 54dbc3
                   [define the osm vendor type to build]),
Packit Service 54dbc3
AC_MSG_NOTICE(Using OSM Vendor Type:$with_osmv),
Packit Service 54dbc3
with_osmv="openib")
Packit Service 54dbc3
Packit Service 54dbc3
dnl Define a way for the user to provide the path to the ibumad installation
Packit Service 54dbc3
AC_ARG_WITH(umad-prefix,
Packit Service 54dbc3
    AC_HELP_STRING([--with-umad-prefix=<dir>],
Packit Service 54dbc3
                   [define the dir used as prefix for ibumad installation]),
Packit Service 54dbc3
AC_MSG_NOTICE(Using ibumad installation prefix:$with_umad_prefix),
Packit Service 54dbc3
with_umad_prefix="")
Packit Service 54dbc3
Packit Service 54dbc3
dnl Define a way for the user to provide the path to the ibumad includes
Packit Service 54dbc3
AC_ARG_WITH(umad-includes,
Packit Service 54dbc3
    AC_HELP_STRING([--with-umad-includes=<dir>],
Packit Service 54dbc3
                   [define the dir where ibumad includes are installed]),
Packit Service 54dbc3
AC_MSG_NOTICE(Using ibumad includes from:$with_umad_includes),
Packit Service 54dbc3
with_umad_includes="")
Packit Service 54dbc3
Packit Service 54dbc3
if test x$with_umad_includes = x; then
Packit Service 54dbc3
   if test x$with_umad_prefix != x; then
Packit Service 54dbc3
      with_umad_includes=$with_umad_prefix/include
Packit Service 54dbc3
   fi
Packit Service 54dbc3
fi
Packit Service 54dbc3
Packit Service 54dbc3
dnl Define a way for the user to provide the path to the ibumad libs
Packit Service 54dbc3
AC_ARG_WITH(umad-libs,
Packit Service 54dbc3
    AC_HELP_STRING([--with-umad-libs=<dir>],
Packit Service 54dbc3
                   [define the dir where ibumad libs are installed]),
Packit Service 54dbc3
AC_MSG_NOTICE(Using ibumad libs from:$with_umad_libs),
Packit Service 54dbc3
with_umad_libs="")
Packit Service 54dbc3
Packit Service 54dbc3
if test x$with_umad_libs = x; then
Packit Service 54dbc3
   if test x$with_umad_prefix != x; then
Packit Service 54dbc3
dnl Should we use lib64 or lib
Packit Service 54dbc3
      if test "$(uname -m)" = "x86_64" -o "$(uname -m)" = "ppc64"; then
Packit Service 54dbc3
         with_umad_libs=$with_umad_prefix/lib64
Packit Service 54dbc3
      else
Packit Service 54dbc3
         with_umad_libs=$with_umad_prefix/lib
Packit Service 54dbc3
      fi
Packit Service 54dbc3
   fi
Packit Service 54dbc3
fi
Packit Service 54dbc3
Packit Service 54dbc3
dnl Define a way for the user to provide the path to the simulator installation
Packit Service 54dbc3
AC_ARG_WITH(sim,
Packit Service 54dbc3
    AC_HELP_STRING([--with-sim=<dir>],
Packit Service 54dbc3
                   [define the simulator prefix for building sim vendor (default /usr)]),
Packit Service 54dbc3
AC_MSG_NOTICE(Using Simulator from:$with_sim),
Packit Service 54dbc3
with_sim="/usr")
Packit Service 54dbc3
Packit Service 54dbc3
dnl based on the with_osmv we can try the vendor flag
Packit Service 54dbc3
if test $with_osmv = "openib"; then
Packit Service 54dbc3
   AC_DEFINE(OSM_VENDOR_INTF_OPENIB, 1, [Define as 1 for OpenIB vendor])
Packit Service 54dbc3
   OSMV_INCLUDES="-I\$(srcdir)/../include -I\$(srcdir)/../../libibumad/include -I\$(includedir)"
Packit Service 54dbc3
   OSMV_LDADD="-L\$(abs_srcdir)/../../libibumad/.libs -L\$(libdir) -libumad"
Packit Service 54dbc3
Packit Service 54dbc3
   if test "x$with_umad_libs" != "x"; then
Packit Service 54dbc3
      OSMV_LDADD="-L$with_umad_libs $OSMV_LDADD"
Packit Service 54dbc3
   fi
Packit Service 54dbc3
Packit Service 54dbc3
   if test "x$with_umad_includes" != "x"; then
Packit Service 54dbc3
      OSMV_INCLUDES="-I$with_umad_includes $OSMV_INCLUDES"
Packit Service 54dbc3
   fi
Packit Service 54dbc3
   AC_DEFINE(DUAL_SIDED_RMPP, 1, [Define as 1 if you want Dual Sided RMPP Support])
Packit Service 54dbc3
elif test $with_osmv = "sim" ; then
Packit Service 54dbc3
   AC_DEFINE(OSM_VENDOR_INTF_SIM, 1, [Define as 1 for sim vendor])
Packit Service 54dbc3
   OSMV_INCLUDES="-I$with_sim/include -I\$(srcdir)/../include"
Packit Service 54dbc3
   OSMV_LDADD="-L$with_sim/lib -libmscli"
Packit Service 54dbc3
elif test $with_osmv = "gen1"; then
Packit Service 54dbc3
   AC_DEFINE(OSM_VENDOR_INTF_TS, 1, [Define as 1 for ts vendor])
Packit Service 54dbc3
Packit Service 54dbc3
   if test -z $MTHOME; then
Packit Service 54dbc3
      MTHOME=/usr/local/ibgd/driver/infinihost
Packit Service 54dbc3
   fi
Packit Service 54dbc3
Packit Service 54dbc3
   OSMV_INCLUDES="-I$MTHOME/include -I\$(srcdir)/../include"
Packit Service 54dbc3
Packit Service 54dbc3
   dnl we need to find the TS includes somewhere...
Packit Service 54dbc3
   osmv_found=0
Packit Service 54dbc3
   if test -z $TSHOME; then
Packit Service 54dbc3
      osmv_dir=`uname -r|sed 's/-smp//'`
Packit Service 54dbc3
      osmv_dir_smp=`uname -r`
Packit Service 54dbc3
      for d in /usr/src/linux-$osmv_dir /usr/src/linux-$osmv_dir_smp /lib/modules/$osmv_dir/build /lib/modules/$osmv_dir_smp/build/; do
Packit Service 54dbc3
         if test -f $d/drivers/infiniband/include/ts_ib_useraccess.h; then
Packit Service 54dbc3
            OSMV_INCLUDES="$OSMV_INCLUDES -I$d/drivers/infiniband/include"
Packit Service 54dbc3
            osmv_found=1
Packit Service 54dbc3
         fi
Packit Service 54dbc3
      done
Packit Service 54dbc3
   else
Packit Service 54dbc3
      if test -f  $TSHOME/ts_ib_useraccess.h; then
Packit Service 54dbc3
         OSMV_INCLUDES="$OSMV_INCLUDES -I$TSHOME"
Packit Service 54dbc3
         osmv_found=1
Packit Service 54dbc3
      fi
Packit Service 54dbc3
   fi
Packit Service 54dbc3
   if test $osmv_found = 0; then
Packit Service 54dbc3
      AC_MSG_ERROR([Fail to find gen1 include files dir])
Packit Service 54dbc3
   fi
Packit Service 54dbc3
   OSMV_LDADD="-L/usr/local/ibgd/driver/infinihost/lib -lvapi -lmosal -lmtl_common -lmpga"
Packit Service 54dbc3
elif test $with_osmv = "vapi"; then
Packit Service 54dbc3
   AC_DEFINE(OSM_VENDOR_INTF_MTL, 1, [Define as 1 for vapi vendor])
Packit Service 54dbc3
   OSMV_INCLUDES="-I/usr/mellanox/include -I/usr/include -I\$(srcdir)/../include"
Packit Service 54dbc3
   OSMV_LDADD="-L/usr/lib -L/usr/mellanox/lib -lib_mgt -lvapi -lmosal -lmtl_common -lmpga"
Packit Service 54dbc3
else
Packit Service 54dbc3
   AC_MSG_ERROR([Invalid Vendor Type provided:$with_osmv should be either openib,sim,gen1])
Packit Service 54dbc3
fi
Packit Service 54dbc3
Packit Service 54dbc3
AM_CONDITIONAL(OSMV_VAPI, test $with_osmv = "vapi")
Packit Service 54dbc3
AM_CONDITIONAL(OSMV_GEN1, test $with_osmv = "gen1")
Packit Service 54dbc3
AM_CONDITIONAL(OSMV_SIM, test $with_osmv = "sim")
Packit Service 54dbc3
AM_CONDITIONAL(OSMV_OPENIB, test $with_osmv = "openib")
Packit Service 54dbc3
AC_DEFINE(VENDOR_RMPP_SUPPORT, 1, [Define as 1 if you want Vendor RMPP Support])
Packit Service 54dbc3
Packit Service 54dbc3
AC_SUBST(OSMV_LDADD)
Packit Service 54dbc3
AC_SUBST(OSMV_INCLUDES)
Packit Service 54dbc3
Packit Service 54dbc3
# --- END OPENIB_APP_OSMV_SEL ---
Packit Service 54dbc3
]) dnl OPENIB_APP_OSMV_SEL
Packit Service 54dbc3
Packit Service 54dbc3
dnl Check for the vendor lib dependency
Packit Service 54dbc3
AC_DEFUN([OPENIB_APP_OSMV_CHECK_LIB], [
Packit Service 54dbc3
# --- BEGIN OPENIB_APP_OSMV_CHECK_LIB ---
Packit Service 54dbc3
if test "$disable_libcheck" != "yes"; then
Packit Service 54dbc3
Packit Service 54dbc3
 dnl based on the with_osmv we can try the vendor flag
Packit Service 54dbc3
 if test $with_osmv = "openib"; then
Packit Service 54dbc3
   LDADD="$LDADD $OSMV_LDADD"
Packit Service 54dbc3
   AC_CHECK_LIB(ibumad, umad_init, [],
Packit Service 54dbc3
	 AC_MSG_ERROR([umad_init() not found. libosmvendor of type openib requires libibumad.]))
Packit Service 54dbc3
 elif test $with_osmv = "sim" ; then
Packit Service 54dbc3
   LDFLAGS="$LDFLAGS -L$with_sim/lib"
Packit Service 54dbc3
   AC_CHECK_FILE([$with_sim/lib/libibmscli.a], [],
Packit Service 54dbc3
    AC_MSG_ERROR([ibms_bind() not found. libosmvendor of type sim requires libibmscli.]))
Packit Service 54dbc3
 elif test $with_osmv = "gen1"; then
Packit Service 54dbc3
   LDFLAGS="$LDFLAGS -L$MTHOME/lib -L$MTHOME/lib64 -lmosal -lmtl_common -lmpga"
Packit Service 54dbc3
   AC_CHECK_LIB(vapi, vipul_init, [],
Packit Service 54dbc3
    AC_MSG_ERROR([vipul_init() not found. libosmvendor of type gen1 requires libvapi.]))
Packit Service 54dbc3
 elif test $with_osmv != "vapi"; then
Packit Service 54dbc3
   AC_MSG_ERROR([OSM Vendor Type not defined: please make sure OPENIB_APP_OSMV SEL is run before CHECK_LIB])
Packit Service 54dbc3
 fi
Packit Service 54dbc3
fi
Packit Service 54dbc3
# --- END OPENIB_APP_OSMV_CHECK_LIB ---
Packit Service 54dbc3
]) dnl OPENIB_APP_OSMV_CHECK_LIB
Packit Service 54dbc3
Packit Service 54dbc3
dnl Check for the vendor lib dependency
Packit Service 54dbc3
AC_DEFUN([OPENIB_APP_OSMV_CHECK_HEADER], [
Packit Service 54dbc3
# --- BEGIN OPENIB_APP_OSMV_CHECK_HEADER ---
Packit Service 54dbc3
Packit Service 54dbc3
dnl we might be required to ignore this check
Packit Service 54dbc3
if test "$disable_libcheck" != "yes"; then
Packit Service 54dbc3
 if test $with_osmv = "openib"; then
Packit Service 54dbc3
   osmv_headers=infiniband/umad.h
Packit Service 54dbc3
 elif test $with_osmv = "sim" ; then
Packit Service 54dbc3
   osmv_headers=ibmgtsim/ibms_client_api.h
Packit Service 54dbc3
 elif test $with_osmv = "gen1"; then
Packit Service 54dbc3
   osmv_headers=
Packit Service 54dbc3
 elif test $with_osmv = "vapi"; then
Packit Service 54dbc3
   osmv_headers=vapi.h
Packit Service 54dbc3
 else
Packit Service 54dbc3
   AC_MSG_ERROR([OSM Vendor Type not defined: please make sure OPENIB_APP_OSMV SEL is run before CHECK_HEADER])
Packit Service 54dbc3
 fi
Packit Service 54dbc3
 if test "x$osmv_headers" != "x"; then
Packit Service 54dbc3
   AC_CHECK_HEADERS($osmv_headers)
Packit Service 54dbc3
 fi
Packit Service 54dbc3
fi
Packit Service 54dbc3
# --- END OPENIB_APP_OSMV_CHECK_HEADER ---
Packit Service 54dbc3
]) dnl OPENIB_APP_OSMV_CHECK_HEADER
Packit Service 54dbc3
Packit Service 54dbc3
dnl Check for socket console support
Packit Service 54dbc3
AC_DEFUN([OPENIB_OSM_CONSOLE_SOCKET_SEL], [
Packit Service 54dbc3
# --- BEGIN OPENIB_OSM_CONSOLE_SOCKET_SEL ---
Packit Service 54dbc3
Packit Service 54dbc3
dnl Console over a loopback socket is default if libwrap is available
Packit Service 54dbc3
AC_MSG_CHECKING([to enable console loopback])
Packit Service 54dbc3
AC_ARG_ENABLE(console-loopback,
Packit Service 54dbc3
[  --enable-console-loopback Enable a console socket on the loopback interface, requires tcp_wrappers (default yes)],
Packit Service 54dbc3
[case $enableval in
Packit Service 54dbc3
     yes) console_loopback=yes ;;
Packit Service 54dbc3
     no)  console_loopback=no ;;
Packit Service 54dbc3
   esac],
Packit Service 54dbc3
   console_loopback=yes)
Packit Service 54dbc3
AC_MSG_RESULT([$console_loopback])
Packit Service 54dbc3
Packit Service 54dbc3
if test $console_loopback = yes; then
Packit Service 54dbc3
AC_CHECK_LIB(wrap, request_init, [], [console_loopback=no
Packit Service 54dbc3
		AC_MSG_WARN(libwrap is missing. setting console_loopback=no)])
Packit Service 54dbc3
fi
Packit Service 54dbc3
if test $console_loopback = yes; then
Packit Service 54dbc3
  AC_DEFINE(ENABLE_OSM_CONSOLE_LOOPBACK,
Packit Service 54dbc3
	    1,
Packit Service 54dbc3
	    [Define as 1 if you want to enable a loopback console])
Packit Service 54dbc3
fi
Packit Service 54dbc3
Packit Service 54dbc3
dnl Console over a socket connection
Packit Service 54dbc3
AC_MSG_CHECKING([to enable console socket])
Packit Service 54dbc3
AC_ARG_ENABLE(console-socket,
Packit Service 54dbc3
[  --enable-console-socket Enable a console socket, requires --enable-console-loopback (default no)],
Packit Service 54dbc3
[case $enableval in
Packit Service 54dbc3
     yes) console_socket=yes ;;
Packit Service 54dbc3
     no)  console_socket=no ;;
Packit Service 54dbc3
   esac],
Packit Service 54dbc3
   console_socket=no)
Packit Service 54dbc3
AC_MSG_RESULT([$console_socket])
Packit Service 54dbc3
Packit Service 54dbc3
if test $console_socket = yes; then
Packit Service 54dbc3
  if test $console_loopback = no; then
Packit Service 54dbc3
    AC_MSG_ERROR([--enable-console-socket requires --enable-console-loopback])
Packit Service 54dbc3
  fi
Packit Service 54dbc3
  AC_DEFINE(ENABLE_OSM_CONSOLE_SOCKET,
Packit Service 54dbc3
	    1,
Packit Service 54dbc3
	    [Define as 1 if you want to enable a console on a socket connection])
Packit Service 54dbc3
fi
Packit Service 54dbc3
Packit Service 54dbc3
# --- END OPENIB_OSM_CONSOLE_SOCKET_SEL ---
Packit Service 54dbc3
]) dnl OPENIB_OSM_CONSOLE_SOCKET_SEL
Packit Service 54dbc3
Packit Service 54dbc3
Packit Service 54dbc3
Packit Service 54dbc3
dnl Check if they want the PerfMgr
Packit Service 54dbc3
AC_DEFUN([OPENIB_OSM_PERF_MGR_SEL], [
Packit Service 54dbc3
# --- BEGIN OPENIB_OSM_PERF_MGR_SEL ---
Packit Service 54dbc3
Packit Service 54dbc3
dnl enable the perf-mgr
Packit Service 54dbc3
AC_MSG_CHECKING([to enable perf mgr])
Packit Service 54dbc3
AC_ARG_ENABLE(perf-mgr,
Packit Service 54dbc3
[  --enable-perf-mgr Enable the performance manager (default yes)],
Packit Service 54dbc3
   [case $enableval in
Packit Service 54dbc3
     yes) perf_mgr=yes ;;
Packit Service 54dbc3
     no)  perf_mgr=no ;;
Packit Service 54dbc3
   esac],
Packit Service 54dbc3
   perf_mgr=yes)
Packit Service 54dbc3
AC_MSG_RESULT([$perf_mgr])
Packit Service 54dbc3
Packit Service 54dbc3
AC_MSG_CHECKING([to enable perf mgr profiling])
Packit Service 54dbc3
AC_ARG_ENABLE(perf-mgr-profile,
Packit Service 54dbc3
[  --enable-perf-mgr-profile Enable the performance manager profiling (default no)],
Packit Service 54dbc3
	[case $enableval in
Packit Service 54dbc3
	yes) perf_mgr_profile=yes ;;
Packit Service 54dbc3
	no)  perf_mgr_profile=no ;;
Packit Service 54dbc3
	esac],
Packit Service 54dbc3
	perf_mgr_profile=no)
Packit Service 54dbc3
AC_MSG_RESULT([$perf_mgr_profile])
Packit Service 54dbc3
Packit Service 54dbc3
if test $perf_mgr = yes; then
Packit Service 54dbc3
  AC_DEFINE(ENABLE_OSM_PERF_MGR,
Packit Service 54dbc3
	1,
Packit Service 54dbc3
	[Define as 1 if you want to enable the performance manager])
Packit Service 54dbc3
  if test $perf_mgr_profile = yes; then
Packit Service 54dbc3
	AC_DEFINE(ENABLE_OSM_PERF_MGR_PROFILE,
Packit Service 54dbc3
		1,
Packit Service 54dbc3
		[Define as 1 if you want to enable the performance manager profiling code])
Packit Service 54dbc3
  fi
Packit Service 54dbc3
fi
Packit Service 54dbc3
# --- END OPENIB_OSM_PERF_MGR_SEL ---
Packit Service 54dbc3
]) dnl OPENIB_OSM_PERF_MGR_SEL
Packit Service 54dbc3
Packit Service 54dbc3
Packit Service 54dbc3
dnl Check if they want the event plugin
Packit Service 54dbc3
AC_DEFUN([OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL], [
Packit Service 54dbc3
# --- BEGIN OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL ---
Packit Service 54dbc3
Packit Service 54dbc3
dnl enable the default-event-plugin
Packit Service 54dbc3
AC_MSG_CHECKING([to enable default event plugin])
Packit Service 54dbc3
AC_ARG_ENABLE(default-event-plugin,
Packit Service 54dbc3
[  --enable-default-event-plugin  Enable a default event plugin "osmeventplugin" (default no)],
Packit Service 54dbc3
   [case $enableval in
Packit Service 54dbc3
     yes) default_event_plugin=yes ;;
Packit Service 54dbc3
     no)  default_event_plugin=no ;;
Packit Service 54dbc3
   esac],
Packit Service 54dbc3
   default_event_plugin=no)
Packit Service 54dbc3
AC_MSG_RESULT([$default_event_plugin])
Packit Service 54dbc3
Packit Service 54dbc3
if test $default_event_plugin = yes; then
Packit Service 54dbc3
  AC_DEFINE(ENABLE_OSM_DEFAULT_EVENT_PLUGIN,
Packit Service 54dbc3
	    1,
Packit Service 54dbc3
	    [Define as 1 if you want to enable the event plugin])
Packit Service 54dbc3
  DEFAULT_EVENT_PLUGIN=osmeventplugin
Packit Service 54dbc3
else
Packit Service 54dbc3
  DEFAULT_EVENT_PLUGIN=
Packit Service 54dbc3
fi
Packit Service 54dbc3
AC_SUBST([DEFAULT_EVENT_PLUGIN])
Packit Service 54dbc3
Packit Service 54dbc3
# --- END OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL ---
Packit Service 54dbc3
]) dnl OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL