b6eb482012-05-16Tobias S. Josefowitz AC_INIT(mpi.cmod)
7089a42018-02-03Tobias S. Josefowitz AC_ARG_WITH(mpi, MY_DESCR([--with-mpi],[enable MPI suppport]), [], [with_mpi=no])
b6eb482012-05-16Tobias S. Josefowitz AC_MODULE_INIT()
99104f2012-05-22Tobias S. Josefowitz AC_CONFIG_HEADER(mpi_config.h) define(TEST_BUILTIN, [ AC_MSG_CHECKING(for $1) AC_TRY_RUN([ $3 unsigned long lint; int main(int argc, char **argv) { static volatile int foo = 0; foo = (int)$1($2); return 0; } ], AC_MSG_RESULT(yes) AC_DEFINE(translit([HAS_$1], [a-z], [A-Z]), 1, [Whether $1 is available]) , AC_MSG_RESULT(no) ) ])
b6eb482012-05-16Tobias S. Josefowitz 
99104f2012-05-22Tobias S. Josefowitz TEST_BUILTIN(__builtin_expect, [argc,0])
b6eb482012-05-16Tobias S. Josefowitz 
7089a42018-02-03Tobias S. Josefowitz if test "x$with_mpi" == "xyes"
b6eb482012-05-16Tobias S. Josefowitz then AC_MSG_CHECKING(whether MPI is present) AC_TRY_RUN([ #include "mpi.h" int main(int argc, char **argv) { MPI_Comm c; return 0; } ], AC_MSG_RESULT(yes) AC_DEFINE(HAS_MPI, 1, [Whether MPI is available]) LIBS="${LIBS-} -lmpi", AC_MSG_RESULT(no) ) fi AC_OUTPUT(Makefile,echo FOO >stamp-h )