From a32aac32325b3d59d093706d9d8389d9098186f8 Mon Sep 17 00:00:00 2001
From: Christoph Grueninger <christoph.grueninger@iws.uni-stuttgart.de>
Date: Mon, 30 Mar 2015 13:59:11 +0000
Subject: [PATCH] [autotools] Deprecation support for Autotools.

Use CMake instead, use Dune 2.4 whenever possible.
(reviewed by bernd, approved by release manager becker)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14470 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 CHANGELOG                        |  6 ++++++
 m4/Makefile.am                   |  1 +
 m4/dumux.m4                      |  2 ++
 m4/dumux_deprecated_autotools.m4 | 16 ++++++++++++++++
 4 files changed, 25 insertions(+)
 create mode 100644 m4/dumux_deprecated_autotools.m4

diff --git a/CHANGELOG b/CHANGELOG
index 68abe3e737..3a02b5d709 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -38,6 +38,12 @@ Differences Between DuMuX 2.6 and DuMuX 2.7
     printing only the first deviation from the reference solution, it now
     prints the maximum deviation in each field/variable.
 
+* DEPRECATED BUILD SYSTEM: DuMuX 2.7 will be the last release which can be built
+    with the Autotools based build system. It is deprecated and will be removed
+    for DuMuX 2.8. We encourage the change towards CMake, especially with the
+    upcoming DUNE 2.4.
+    The warning can be suppressed with --disable-dumux-deprecated-autotools
+
 * IMMEDIATE INTERFACE CHANGES not allowing/requiring a deprecation period:
   - Before, the "heatCapacity" function in the spatial parameters and volume
     variables of the implicit nonisothermal models was a misnomer, since it
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 88e7b3bf0a..54660c54cb 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -7,6 +7,7 @@ M4FILES = \
 	ac_prog_pdflatex.m4 \
 	cxx0x_constexpr.m4 \
 	dumux.m4 \
+	dumux_deprecated_autotools.m4 \
 	dumux_quad.m4
 
 aclocaldir = $(datadir)/aclocal
diff --git a/m4/dumux.m4 b/m4/dumux.m4
index 7b23fa358f..e94af3f510 100644
--- a/m4/dumux.m4
+++ b/m4/dumux.m4
@@ -26,6 +26,8 @@ AC_DEFUN([DUMUX_CHECKS],
   if test "x$HAVE_CONSTEXPR" != "xyes"; then
       AC_DEFINE(constexpr, const, ['set 'constexpr' to 'const' if constexpr is not supported])
   fi
+
+  AC_REQUIRE([DUMUX_DEPRECATED_AUTOTOOLS])
 ])
 
 # checks only relevant for the dumux module itself but not for modules
diff --git a/m4/dumux_deprecated_autotools.m4 b/m4/dumux_deprecated_autotools.m4
new file mode 100644
index 0000000000..539149925d
--- /dev/null
+++ b/m4/dumux_deprecated_autotools.m4
@@ -0,0 +1,16 @@
+dnl This macro introduces a configure flag --disable-dumux-deprecated-autotools
+dnl to suppress the deprecration warning that Autotools will be removed in 2.8
+
+AC_DEFUN([DUMUX_DEPRECATED_AUTOTOOLS],[
+  AC_ARG_ENABLE(dumux-deprecated-autotools,
+    AS_HELP_STRING([--disable-dumux-deprecated-autotools],[Suppresses DuMuX' warning about deprecated Autotools support.]))
+
+  AS_IF([test "x$enable_dumux_deprecated_autotools" != "xno"],
+    AC_DEFINE(ENABLE_DUMUX_DEPRECATED_AUTOTOOLS, 1, [Warn about deprecated Autotools support]))
+
+  AH_BOTTOM([
+#if ENABLE_DUMUX_DEPRECATED_AUTOTOOLS
+#warning Support for Autotools in DuMuX is deprecated and will be removed after 2.7.
+#endif
+])
+])
-- 
GitLab