Skip to content
Snippets Groups Projects
Commit fafc3391 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[m4] Replace more deprecated AC_TRY_COMPILE by AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[.

This commit is related to FS#1257.

[[Imported from SVN: r7394]]
parent 4758ba9b
No related branches found
No related tags found
No related merge requests found
......@@ -74,20 +74,30 @@ if test x = x"$MPILIBS"; then
AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"])
fi
dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the
dnl We have to use AC_COMPILE_IFELSE and not AC_CHECK_HEADER because the
dnl latter uses $CPP, not $CC (which may be mpicc).
AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then
AC_MSG_CHECKING([for mpi.h])
export LAMMPICC="$acx_mpi_save_CC"
AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
AC_MSG_RESULT(no)])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <mpi.h>
]], [])],
AC_MSG_RESULT(yes),
[MPILIBS=""
AC_MSG_RESULT(no)])
unset LAMMPICC
fi],
[C++], [if test x != x"$MPILIBS"; then
AC_MSG_CHECKING([for mpi.h])
export LAMMPICXX="$acx_mpi_save_CXX"
AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
AC_MSG_RESULT(no)])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <mpi.h>
]], [])],
AC_MSG_RESULT(yes),
[MPILIBS=""
AC_MSG_RESULT(no)])
unset LAMMPICXX
fi])
......
......@@ -3,17 +3,18 @@
AC_DEFUN([DUNE_CHECK_CXA_DEMANGLE],[
AC_CACHE_CHECK([for abi::__cxa_demangle], dune_cv_cxa_demangle, [
AC_LANG_PUSH([C++])
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <cxxabi.h>
],
[
]],
[[
int foobar = 0;
const char *foo = typeid(foobar).name();
int status;
char *demangled = abi::__cxa_demangle( foo, 0, 0, &status );
],
dune_cv_cxa_demangle="yes",
dune_cv_cxa_demangle="no")
]]
)],
dune_cv_cxa_demangle="yes",
dune_cv_cxa_demangle="no")
AC_LANG_POP([C++])
])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment