-# LB_CONFIG_OFED_BACKPORTS
-#
-# include any OFED backport headers in all compile commands
-# NOTE: this does only include the backport paths, not the OFED headers
-# adding the OFED headers is done in the lnet portion
-AC_DEFUN([LB_CONFIG_OFED_BACKPORTS],
-[AC_MSG_CHECKING([whether to use any OFED backport headers])
-if test $ENABLEO2IB -eq 0; then
- AC_MSG_RESULT([no])
-else
- if ! $o2ib_found; then
- AC_MSG_RESULT([no])
- case $ENABLEO2IB in
- 1) ;;
- 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
- 3) AC_MSG_ERROR([bad --with-o2ib path]);;
- *) AC_MSG_ERROR([internal error]);;
- esac
- else
- if ! $compatrdma_found; then
- if test -f $O2IBPATH/config.mk; then
- . $O2IBPATH/config.mk
- elif test -f $O2IBPATH/ofed_patch.mk; then
- . $O2IBPATH/ofed_patch.mk
- fi
- else
- case $RHEL_KERNEL_VERSION in
- 2.6.32-358*)
- EXTRA_LNET_INCLUDE="$EXTRA_LNET_INCLUDE -DCONFIG_COMPAT_RHEL_6_4";;
- esac
- fi
- if test -n "$BACKPORT_INCLUDES"; then
- OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
- EXTRA_LNET_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_LNET_INCLUDE"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- fi
-fi
-])
-
-# LC_MODULE_LOADING
-# after 2.6.28 CONFIG_KMOD is removed, and only CONFIG_MODULES remains
-# so we test if request_module is implemented or not
-AC_DEFUN([LC_MODULE_LOADING],
-[AC_MSG_CHECKING([if kernel module loading is possible])
-LB_LINUX_TRY_MAKE([
- #include <linux/kmod.h>
-],[
- int myretval=ENOSYS ;
- return myretval;
-],[
- $makerule LUSTRE_KERNEL_TEST=conftest.i
-],[dnl
- grep request_module build/conftest.i |dnl
- grep -v `grep "int myretval=" build/conftest.i |dnl
- cut -d= -f2 | cut -d" " -f1`dnl
- >/dev/null dnl
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_MODULE_LOADING_SUPPORT, 1,
- [kernel module loading is possible])
-],[
- AC_MSG_RESULT(no)
- AC_MSG_WARN([])
- AC_MSG_WARN([Kernel module loading support is highly recommended.])
- AC_MSG_WARN([])
-])
+# LB_CHECK_COMPILE
+# $1 - checking message
+# $2 - variable name
+# $3 - header
+# $4 - body
+# $5 - do 'yes'
+# $6 - do 'no'
+#
+AC_DEFUN([LB_CHECK_COMPILE], [
+AS_VAR_PUSHDEF([lb_compile], [lb_cv_compile_$2])dnl
+AC_CACHE_CHECK([$1], lb_compile, [
+ LB_LINUX_TRY_COMPILE([$3], [$4],
+ [AS_VAR_SET([lb_compile], [yes])],
+ [AS_VAR_SET([lb_compile], [no])])