From 42961d2094a8d28dc5de6bee0bf6aa8b68d11c5f Mon Sep 17 00:00:00 2001 From: eeb Date: Wed, 30 Mar 2005 18:05:07 +0000 Subject: [PATCH] * Changed --with-iib to allow a path to the installed Infinicon headers --- lnet/autoconf/lustre-lnet.m4 | 90 +++++++++++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 23 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 22c5b06..0768673 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -228,31 +228,75 @@ AC_SUBST(OPENIBNAL) # # check for infinicon infiniband support # -AC_DEFUN([LP_CONFIG_IIB], -[AC_MSG_CHECKING([if Infinicon IB kernel headers are present]) -# for how the only infinicon ib build has headers in /usr/include/iba -IIBCPPFLAGS="-I/usr/include -DIN_TREE_BUILD" -EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" -EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS" -LB_LINUX_TRY_COMPILE([ - #include -],[ - IBT_INTERFACE_UNION interfaces; - FSTATUS rc; +# +# LP_CONFIG_IIB +# +# check for infinicon infiniband support +# +AC_DEFUN([LP_CONFIG_IIB],[ +AC_MSG_CHECKING([whether to enable Infinicon support]) +# set default +IIBPATH="/usr/include" +AC_ARG_WITH([iib], + AC_HELP_STRING([--with-iib=path], + [build iibnal against path]), + [ + case $with_iib in + yes) ENABLEIIB=2 + ;; + no) ENABLEIIB=0 + ;; + *) IIBPATH="${with_iib}/include" + ENABLEIIB=3 + ;; + esac + ],[ + ENABLEIIB=1 + ]) +if test $ENABLEIIB -eq 0; then + AC_MSG_RESULT([disabled]) +elif test ! \( -f ${IIBPATH}/linux/iba/ibt.h \); then + AC_MSG_RESULT([no]) + case $ENABLEIIB in + 1) ;; + 2) AC_MSG_ERROR([default Infinicon headers not present]);; + 3) AC_MSG_ERROR([bad --with-iib path]);; + *) AC_MSG_ERROR([internal error]);; + esac +else + IIBCPPFLAGS="-I$IIBPATH" + if test $IIBPATH != "/usr/include"; then + # we need /usr/include come what may + IIBCPPFLAGS="$IIBCPPFLAGS -I/usr/include" + fi + EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="$EXTRA_KCFLAGS $IIBCPPFLAGS" + LB_LINUX_TRY_COMPILE([ + #include + ],[ + IBT_INTERFACE_UNION interfaces; + FSTATUS rc; - rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2, - &interfaces); + rc = IbtGetInterfaceByVersion(IBT_INTERFACE_VERSION_2, + &interfaces); - return rc == FSUCCESS ? 0 : 1; -],[ - AC_MSG_RESULT([yes]) - IIBNAL="iibnal" -],[ - AC_MSG_RESULT([no]) - IIBNAL="" - IIBCPPFLAGS="" -]) -EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" + return rc == FSUCCESS ? 0 : 1; + ],[ + AC_MSG_RESULT([yes]) + IIBNAL="iibnal" + ],[ + AC_MSG_RESULT([no]) + case $ENABLEIIB in + 1) ;; + 2) AC_MSG_ERROR([can't compile with default Infinicon headers]);; + 3) AC_MSG_ERROR([can't compile with Infinicon headers under $IIBPATH]);; + *) AC_MSG_ERROR([internal error]);; + esac + IIBNAL="" + IIBCPPFLAGS="" + ]) + EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" +fi AC_SUBST(IIBCPPFLAGS) AC_SUBST(IIBNAL) ]) -- 1.8.3.1