Whamcloud - gitweb
LU-11946 build: no yaml check during configure --enable-dist
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
index 909cc7e..1e51ba0 100644 (file)
@@ -81,10 +81,12 @@ AS_IF([test "x$enable_backoff" = xyes], [
 # fail to build if libyaml is not installed
 #
 AC_DEFUN([LN_CONFIG_DLC], [
-       AC_CHECK_LIB([yaml], [yaml_parser_initialize],
-                    [LIBYAML="libyaml"],
-                    [AC_MSG_ERROR([YAML development libraries not not installed])],
-                    [-lm])
+       AS_IF([test "x$enable_dist" = xno], [
+               AC_CHECK_LIB([yaml], [yaml_parser_initialize],
+                            [LIBYAML="libyaml"],
+                            [AC_MSG_ERROR([YAML development libraries not not installed])],
+                            [-lm])
+       ])
 ])
 
 #
@@ -114,7 +116,7 @@ case $with_o2ib in
                                OFED_INFO="ofed_info"
                                LSPKG="rpm -ql"
                        ])
-                       O2IBPATHS=$(eval $OFED_INFO | egrep -w 'mlnx-ofed-kernel-dkms|mlnx-ofa_kernel-devel|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel' | xargs $LSPKG | grep '\(/openib\|/ofa_kernel/default\)$' | head -n1)
+                       O2IBPATHS=$(eval $OFED_INFO | egrep -w 'mlnx-ofed-kernel-dkms|mlnx-ofa_kernel-devel|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel' | xargs $LSPKG | grep '\(/openib\|/ofa_kernel/default\|/ofa_kernel\)$' | head -n1)
                        AS_IF([test -z "$O2IBPATHS"], [
                                AC_MSG_ERROR([
 You seem to have an OFED installed but have not installed it's devel package.
@@ -129,6 +131,11 @@ If you still want to build Lustre for your OFED I/B stack, you need to install a
 Instead, if you want to build Lustre for your kernel's built-in I/B stack rather than your installed OFED stack, either remove the OFED package(s) or use --with-o2ib=no.
                                             ])
                        ])
+                       if test -e $O2IBPATHS/${LINUXRELEASE}; then
+                           O2IBPATHS=$O2IBPATHS/${LINUXRELEASE}
+                       elif test -e $O2IBPATHS/default; then
+                           O2IBPATHS=$O2IBPATHS/default
+                       fi
                        OFED="yes"
                ], [
                        O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
@@ -249,16 +256,13 @@ AS_IF([test $ENABLEO2IB = "no"], [
                # we know at this point that the found OFED source is good
                O2IB_SYMVER=""
                if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
-                       # OFED default rpm not handle sles10 Modules.symvers name
-                       for name in Module.symvers Modules.symvers; do
-                               if test -f $O2IBPATH/$name; then
-                                       O2IB_SYMVER=$name;
-                                       break;
-                               fi
-                       done
+                       if test -f $O2IBPATH/Module.symvers; then
+                               O2IB_SYMVER=$O2IBPATH/Module.symvers;
+                               break;
+                       fi
                        if test -n "$O2IB_SYMVER"; then
-                               AC_MSG_NOTICE([adding $O2IBPATH/$O2IB_SYMVER to Symbol Path])
-                               EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IBPATH/$O2IB_SYMVER"
+                               AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path])
+                               EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
                                AC_SUBST(EXTRA_SYMBOLS)
                        else
                                AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
@@ -535,6 +539,32 @@ AS_IF([test $ENABLEO2IB != "no"], [
                          [function ib_inc_rkey exist])
        ])
 
+       # In MOFED 4.6, the second and third parameters for
+       # ib_post_send() and ib_post_recv() are declared with
+       # 'const'.
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+       LB_CHECK_COMPILE([if 'ib_post_send() and ib_post_recv()' have const parameters],
+       ib_post_send_recv_const, [
+               #ifdef HAVE_COMPAT_RDMA
+               #undef PACKAGE_NAME
+               #undef PACKAGE_TARNAME
+               #undef PACKAGE_VERSION
+               #undef PACKAGE_STRING
+               #undef PACKAGE_BUGREPORT
+               #undef PACKAGE_URL
+               #include <linux/compat-2.6.h>
+               #endif
+               #include <rdma/ib_verbs.h>
+       ],[
+               ib_post_send(NULL, (const struct ib_send_wr *)NULL,
+                            (const struct ib_send_wr **)NULL);
+       ],[
+               AC_DEFINE(HAVE_IB_POST_SEND_RECV_CONST, 1,
+                       [ib_post_send and ib_post_recv have const parameters])
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+
        EXTRA_CHECK_INCLUDE=""
 ]) # ENABLEO2IB != "no"
 ]) # LN_CONFIG_O2IB
@@ -713,6 +743,27 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LN_CONFIG_SOCK_ACCEPT
 
 #
+# LN_CONFIG_SOCK_GETNAME
+#
+# 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname()
+# does not take the length *int argument and returns the length
+#
+AC_DEFUN([LN_CONFIG_SOCK_GETNAME], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if 'getname' has two args],
+kern_sock_getname_2args, [
+       #include <linux/net.h>
+],[
+       kernel_getsockname(NULL, NULL);
+],[
+       AC_DEFINE(HAVE_KERN_SOCK_GETNAME_2ARGS, 1,
+               ['getname' has two args])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LN_CONFIG_SOCK_GETNAME
+
+#
 # LN_PROG_LINUX
 #
 # LNet linux kernel checks
@@ -737,6 +788,8 @@ LN_CONFIG_SK_DATA_READY
 LN_CONFIG_SOCK_CREATE_KERN
 # 4.11
 LN_CONFIG_SOCK_ACCEPT
+# 4.17
+LN_CONFIG_SOCK_GETNAME
 ]) # LN_PROG_LINUX
 
 #