From fafc33918fef333a88eb0ea3ec1a769b323c1ca3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org>
Date: Tue, 26 Feb 2013 21:48:46 +0000
Subject: [PATCH] [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]]
---
 m4/acx_mpi.m4           | 20 +++++++++++++++-----
 m4/dune_cxa_demangle.m4 | 13 +++++++------
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/m4/acx_mpi.m4 b/m4/acx_mpi.m4
index 5b36119f2..8cdceee0f 100644
--- a/m4/acx_mpi.m4
+++ b/m4/acx_mpi.m4
@@ -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])
 
diff --git a/m4/dune_cxa_demangle.m4 b/m4/dune_cxa_demangle.m4
index d87396afa..b84eea409 100644
--- a/m4/dune_cxa_demangle.m4
+++ b/m4/dune_cxa_demangle.m4
@@ -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++])
     ])
 
-- 
GitLab