From 0f250ca393e737bfd2bcb66d9850d26a6d1d8089 Mon Sep 17 00:00:00 2001
From: grev <grev>
Date: Tue, 2 Sep 2008 19:08:42 +0000
Subject: [PATCH] b=16809 i=Adilger build mpitests only if --disable-mpitests
 is not set

---
 lustre/autoconf/lustre-core.m4 | 68 +++++++++++++++++++---------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
index c729a0ed5e..dc3c031fd7 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
@@ -1431,40 +1431,50 @@ if test x$enable_liblustre_acl = xyes ; then
 fi
 
 #
-# check --with-mpi option
-#
-AC_ARG_WITH([mpi],
-            AC_HELP_STRING([--with-mpi=path],
-                           [set path to mpi install (default=/opt/mpich)]),
-            [
-             case $with_mpi in
-             [[\\/$]]* | ?:[[\\/]]* )
-                 ;;
-             *)
-                 AC_MSG_ERROR([expected absolute directory name for --with-mpi])
+# --enable-mpitest
+#
+AC_ARG_ENABLE(mpitests,
+	AC_HELP_STRING([--enable-mpitest=yes|no|mpich directory],
+                           [include mpi tests]),
+	[
+	 enable_mpitests=yes
+         case $enableval in
+         yes)
+		MPI_ROOT=/opt/mpich
+		LDFLAGS="$LDFLAGS -L$MPI_ROOT/ch-p4/lib -L$MPI_ROOT/ch-p4/lib64"
+		CFLAGS="$CFLAGS -I$MPI_ROOT/include"
+		;;
+         no)
+		enable_mpitests=no
+		;;
+	 [[\\/$]]* | ?:[[\\/]]* )
+		MPI_ROOT=$enableval
+		LDFLAGS="$LDFLAGS -L$with_mpi/lib"
+		CFLAGS="$CFLAGS -I$MPI_ROOT/include"
+                ;;
+         *)
+                 AC_MSG_ERROR([expected absolute directory name for --enable-mpitests or yes or no])
                  ;;
-             esac
-
-             MPI_ROOT=$with_mpi
-             LDFLAGS="$LDFLAGS -L$with_mpi/lib"
-             CFLAGS="$CFLAGS -I$with_mpi/include"
-            ],
-            [
-             MPI_ROOT=/opt/mpich
-             LDFLAGS="$LDFLAGS -L$MPI_ROOT/ch-p4/lib -L$MPI_ROOT/ch-p4/lib64"
-             CFLAGS="$CFLAGS -I$MPI_ROOT/include"
-            ])
+	 esac
+	],
+	[
+	MPI_ROOT=/opt/mpich
+        LDFLAGS="$LDFLAGS -L$MPI_ROOT/ch-p4/lib -L$MPI_ROOT/ch-p4/lib64"
+        CFLAGS="$CFLAGS -I$MPI_ROOT/include"
+	enable_mpitests=yes
+	]
+)
 AC_SUBST(MPI_ROOT)
 
-#
-# check mpi's includes and library
-#
-AC_MSG_CHECKING([whether to build mpitests])
-AC_CHECK_FILE([$MPI_ROOT/include/mpi.h],
-              [AC_CHECK_LIB([mpich],[MPI_Start],[enable_mpitests=yes],[enable_mpitests=no])],
-              [enable_mpitests=no])
+if test x$enable_mpitests != xno; then
+	AC_MSG_CHECKING([whether to mpitests can be built])
+        AC_CHECK_FILE([$MPI_ROOT/include/mpi.h],
+                      [AC_CHECK_LIB([mpich],[MPI_Start],[enable_mpitests=yes],[enable_mpitests=no])],
+                      [enable_mpitests=no])
+fi
 AC_MSG_RESULT([$enable_mpitests])
 
+
 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
 
-- 
GitLab