Hello again!

On 12/21/2010 03:16 PM, Olaf Lenz wrote:
> The problem seems to be that AC_PROG_CC doesn't work when using it in
> a conditional, is that right? Is there any simple way to do what I
> want?

After some trial and error I have found a solution for my problem that
is very simple. Now I wonder whether this is actually the correct way to
do it, or are there some hidden pitfalls?

Olaf

-- 
Dr. rer. nat. Olaf Lenz
Institut für Computerphysik, Pfaffenwaldring 27, D-70569 Stuttgart
Phone: +49-711-685-63607
AC_INIT(ESPResSo, [2.9.0], [espressomd-us...@nongnu.org])

AC_ARG_WITH(mpi,,, [with_mpi=guess])
if test x"$with_mpi" != xno; then
  COMPILERS="mpicc hcc mpxlc_r mpxlc mpcc cmpicc gcc cc"
else
  COMPILERS="gcc cc"
fi
AC_PROG_CC($COMPILERS)

AS_IF([test x"$with_mpi" != xno], [
  # test whether MPI_Init is available now
  AC_CHECK_FUNC(MPI_Init,, [
      # if not, give up or use fake
      if test xyes = x"$with_mpi"; then
        AC_MSG_FAILURE([MPI compiler requested, but couldn't compile with MPI.])
      else
        AC_MSG_WARN([No MPI compiler found, will use fake implementation!])
        use_mpi_fake="yes"
      fi
  ])
])

# if requested, use the fake implementation
#AM_CONDITIONAL(MPI_FAKE, [test x$use_mpi_fake = xyes])

<<attachment: olenz.vcf>>

_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to