--- /dev/null
+dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl
+dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+dnl
+dnl
+dnl
+
+AC_DEFUN([CHECK_MPI],[
+
+AC_REQUIRE([AC_PROG_CC])dnl
+
+AC_ARG_WITH(mpi,
+ --with-mpi=DIR root directory path of MPICH installation,
+ WITHMPI="yes",WITHMPI="no")
+
+MPI_INCLUDES=""
+MPI_LIBS=""
+if test "$WITHMPI" = yes; then
+
+ echo
+ echo ---------------------------------------------
+ echo testing mpi
+ echo ---------------------------------------------
+ echo
+
+ if test "x$withval" != "xyes"; then
+ MPI_HOME=$withval
+ MPI_INCLUDES="-I$MPI_HOME/include"
+ MPI_LIBS="-L$MPI_HOME/lib"
+ fi
+
+ CPPFLAGS_old="$CPPFLAGS"
+ CPPFLAGS="$MPI_INCLUDES $CPPFLAGS"
+ AC_CHECK_HEADER(mpi.h,WITHMPI="yes",WITHMPI="no")
+ CPPFLAGS="$CPPFLAGS_old"
+
+ if test "$WITHMPI" = "yes";then
+ LDFLAGS_old="$LDFLAGS"
+ LDFLAGS="$MPI_LIBS $LDFLAGS"
+ AC_CHECK_LIB(elan,elan_init,MPI_LIBS="$MPI_LIBS -lelan")
+ AC_CHECK_LIB(mpi,MPI_Init,WITHMPI="yes",WITHMPI="no")
+ LDFLAGS="$LDFLAGS_old"
+ fi
+
+ if test "$WITHMPI" = "yes";then
+ mpi_ok=yes
+ MPI_LIBS="$MPI_LIBS -lmpi"
+ fi
+
+fi
+AC_SUBST(MPI_INCLUDES)
+AC_SUBST(MPI_LIBS)
+AC_SUBST(WITHMPI)
+
+])dnl
BIN_SRC =
BIN_SERVER_IDL = SALOME_MPIObject.idl SALOME_MPIContainer.idl
-CXXFLAGS+=${MPICH_INCLUDES}
-CXX_DEPEND_FLAG+=${MPICH_INCLUDES}
-LDFLAGS+= -lSalomeContainer -lSalomeNS -lRegistry -lOpUtil ${MPICH_LIBS}
+LDFLAGS+= -lSalomeContainer -lSalomeNS -lRegistry -lOpUtil
+ifeq (@WITHMPICH@,yes)
+ CXXFLAGS+=${MPICH_INCLUDES}
+ CXX_DEPEND_FLAG+=${MPICH_INCLUDES}
+ LDFLAGS+= ${MPICH_LIBS}
+endif
+
+ifeq (@WITHMPI@,yes)
+ CXXFLAGS+=${MPI_INCLUDES}
+ CXX_DEPEND_FLAG+=${MPI_INCLUDES}
+ LDFLAGS+= ${MPI_LIBS}
+endif
@CONCLUDE@