Whamcloud - gitweb
* Made openib not use the subnet manager to discover connection parameters
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
index e9c466a..c72b2ff 100644 (file)
@@ -131,34 +131,52 @@ AC_SUBST(GMNAL)
 AC_DEFUN([LP_CONFIG_OPENIB],[
 AC_MSG_CHECKING([whether to enable OpenIB support])
 # set default
-DFLTOPENIBCPPFLAGS="-I$LINUX/drivers/infiniband/include -DIN_TREE_BUILD"
+OPENIBPATH="$LINUX/drivers/infiniband"
 AC_ARG_WITH([openib],
        AC_HELP_STRING([--with-openib=path],
                       [build openibnal against path]),
        [
                case $with_openib in
-               yes)    OPENIBCPPFLAGS="$DFLTOPENIBCPPFLAGS"
-                       ENABLEOPENIB=2
+               yes)    ENABLEOPENIB=2
                        ;;
                no)     ENABLEOPENIB=0
                        ;;
-               *)      OPENIBCPPFLAGS="-I$with_openib/include"
+               *)      OPENIBPATH="$with_openib"
                        ENABLEOPENIB=3
                        ;;
                esac
        ],[
-                OPENIBCPPFLAGS="$DFLTOPENIBCPPFLAGS"
                ENABLEOPENIB=1
        ])
 if test $ENABLEOPENIB -eq 0; then
        AC_MSG_RESULT([disabled])
+elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \
+               -f ${OPENIBPATH}/include/ts_ib_cm.h -a\
+              -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then
+       AC_MSG_RESULT([no])
+       case $ENABLEOPENIB in
+       1) ;;
+       2) AC_MSG_ERROR([kernel OpenIB headers not present]);;
+       3) AC_MSG_ERROR([bad --with-openib path]);;
+       *) AC_MSG_ERROR([internal error]);;
+       esac
 else
+       case $ENABLEOPENIB in
+       1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";;
+       3)   OPENIBCPPFLAGS="-I$OPENIBPATH/include";;
+       *)   AC_MSG_RESULT([no])
+            AC_MSG_ERROR([internal error]);;
+       esac
        EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
        LB_LINUX_TRY_COMPILE([
                #include <ts_ib_core.h>
+               #include <ts_ib_cm.h>
+               #include <ts_ib_sa_client.h>
        ],[
-                       struct ib_device_properties props;
+                       struct ib_device_properties dev_props;
+               struct ib_cm_active_param   cm_active_params;
+               tTS_IB_CLIENT_QUERY_TID     tid;
                return 0;
        ],[
                AC_MSG_RESULT([yes])
@@ -167,8 +185,8 @@ else
                AC_MSG_RESULT([no])
                case $ENABLEOPENIB in
                1) ;;
-               2) AC_MSG_ERROR([default openib headers not present]);;
-               3) AC_MSG_ERROR([bad --with-openib path]);;
+               2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);;
+               3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);;
                *) AC_MSG_ERROR([internal error]);;
                esac
                OPENIBNAL=""
@@ -393,9 +411,7 @@ AC_DEFUN([LP_PROG_LINUX],
 LP_CONFIG_AFFINITY
 LP_CONFIG_QUADRICS
 LP_CONFIG_GM
-if test $linux25 = 'no' ; then
-       LP_CONFIG_OPENIB
-fi
+LP_CONFIG_OPENIB
 LP_CONFIG_IIB
 LP_CONFIG_VIB
 LP_CONFIG_RANAL