From 14b3c4c9d8031e27165eddbddf56b83039365797 Mon Sep 17 00:00:00 2001
From: Jorrit Fahlke <joe@dune-project.org>
Date: Tue, 12 Jan 2010 13:24:24 +0000
Subject: [PATCH] remove the older infrastructure for CPPFLAGS-like configure
 substitutions deprecation

[[Imported from SVN: r5809]]
---
 configure.ac                                  |  1 -
 dune/common/Makefile.am                       |  2 +-
 dune/common/warnings/.gitignore               |  2 -
 dune/common/warnings/Makefile.am              |  7 ---
 .../warnings/mpi_cppflags_deprecation.hh      | 12 -----
 m4/Makefile.am                                |  1 -
 m4/dune_cppincludeopt.m4                      | 50 -------------------
 m4/dune_mpi.m4                                | 33 +++++-------
 8 files changed, 13 insertions(+), 95 deletions(-)
 delete mode 100644 dune/common/warnings/.gitignore
 delete mode 100644 dune/common/warnings/Makefile.am
 delete mode 100644 dune/common/warnings/mpi_cppflags_deprecation.hh
 delete mode 100644 m4/dune_cppincludeopt.m4

diff --git a/configure.ac b/configure.ac
index b58819e36..606d44321 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,6 @@ AC_CONFIG_FILES([Makefile
      dune/common/Makefile
      dune/common/test/Makefile
      dune/common/exprtmpl/Makefile
-     dune/common/warnings/Makefile
      doc/Makefile
      doc/devel/Makefile
      doc/layout/Makefile
diff --git a/dune/common/Makefile.am b/dune/common/Makefile.am
index 44295e82d..d0bd1c930 100644
--- a/dune/common/Makefile.am
+++ b/dune/common/Makefile.am
@@ -1,6 +1,6 @@
 # $Id$
 
-SUBDIRS = . test exprtmpl warnings
+SUBDIRS = . test exprtmpl
 
 # the standard debug streams are put into the libdune
 noinst_LTLIBRARIES = libcommon.la
diff --git a/dune/common/warnings/.gitignore b/dune/common/warnings/.gitignore
deleted file mode 100644
index 282522db0..000000000
--- a/dune/common/warnings/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/dune/common/warnings/Makefile.am b/dune/common/warnings/Makefile.am
deleted file mode 100644
index ef6ff56d9..000000000
--- a/dune/common/warnings/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-# $Id$
-
-warningsincludedir = $(includedir)/dune/common/warnings
-warningsinclude_HEADERS =			\
-	mpi_cppflags_deprecation.hh
-
-include $(top_srcdir)/am/global-rules
diff --git a/dune/common/warnings/mpi_cppflags_deprecation.hh b/dune/common/warnings/mpi_cppflags_deprecation.hh
deleted file mode 100644
index f5521b7c3..000000000
--- a/dune/common/warnings/mpi_cppflags_deprecation.hh
+++ /dev/null
@@ -1,12 +0,0 @@
-// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-// vi: set et ts=4 sw=2 sts=2:
-#ifndef DUNE_MPI_CPPFLAGS_DEPRECATION
-#define DUNE_MPI_CPPFLAGS_DEPRECATION
-
-#warning The MPI_CPPFLAGS configure substitute is deprecated.  Please change
-#warning your Makefile.am to use DUNEMPICPPFLAGS instead.  Note that it is a
-#warning good idea to change any occurance of MPI_LDFLAGS into DUNEMPILIBS and
-#warning DUNEMPILDFLAGS as apropriate, since it is not possible to issue a
-#warning deprecation warning in that case.
-
-#endif // DUNE_MPI_CPPFLAGS_DEPRECATION
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 553a136f9..05a12cada 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -3,7 +3,6 @@
 ALLM4S = acx_blas.m4 acx_lapack.m4 acx_mpi.m4 acx_pthread.m4 \
          ax_check_gl.m4 ax_lang_compiler_ms.m4 dune_all.m4 \
          dune_autobuild.m4 dune_common.m4 dune_compiler.m4	\
-	 dune_cppincludeopt.m4					\
 	 dune_deprecated.m4					\
 	 dune_deprecated_cppflags.m4				\
          dune_docu.m4 dune_exprtmpl.m4  dune_linkcxx.m4 \
diff --git a/m4/dune_cppincludeopt.m4 b/m4/dune_cppincludeopt.m4
deleted file mode 100644
index 7f4e95133..000000000
--- a/m4/dune_cppincludeopt.m4
+++ /dev/null
@@ -1,50 +0,0 @@
-dnl -*- autoconf -*-
-# Determine how to make the C preprocessor include a certain file before the
-# main input file from the command line.  Sets the following configure
-# substitution:
-#
-# CPPINCLUDEOPT The include option.  This is something like "-include " (note
-#   trailing space).  If no such option could determined, this variable will
-#   be set to something like "-D DUMMY=".  This means it must be used like
-#   CPPFLAGS="$CPPINCLUDEOPT$header" (note: no whitespace between
-#   $CPPINCLUDEOPT and $header).
-#
-# Sets the following automake conditional:
-#
-# HAVE_CPPINCLUDEOPT
-AC_DEFUN([DUNE_CPPINCLUDEOPT],
-[
-  AC_LANG_PUSH([C])
-  AC_REQUIRE([AC_PROG_CPP])
-
-  AC_MSG_CHECKING([for preprocessor option to preinclude a header])
-
-  cat >conftestpreinc.h <<EOF
-#define PREINC_WORKS
-EOF
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  HAVE_CPPINCLUDEOPT=no
-
-  if ! test yes = "$HAVE_CPPINCLUDEOPT"; then
-    # check for -include
-    CPPINCLUDEOPT="-include "
-    CPPFLAGS="$ac_save_CPPFLAGS ${CPPINCLUDEOPT}conftestpreinc.h"
-    AC_COMPILE_IFELSE([
-#ifdef PREINC_WORKS
-/* OK */
-#else
-#error preinc does not work
-#endif
-    ],[HAVE_CPPINCLUDEOPT=yes])
-  fi
-
-  rm -f conftestpreinc.h
-  if ! test yes = "$HAVE_CPPINCLUDEOPT"; then
-    CPPINCLUDEOPT="-D DUMMY="
-  fi
-  AC_MSG_RESULT([$HAVE_CPPINCLUDEOPT (${CPPINCLUDEOPT}file.h)])
-  AC_SUBST([CPPINCLUDEOPT])
-  AM_CONDITIONAL([HAVE_CPPINCLUDEOPT], [test yes = "$HAVE_CPPINCLUDEOPT"])
-  CPPFLAGS="$ac_save_CPPFLAGS"
-  AC_LANG_POP([C])
-])
diff --git a/m4/dune_mpi.m4 b/m4/dune_mpi.m4
index c60c29699..fd92dfef1 100644
--- a/m4/dune_mpi.m4
+++ b/m4/dune_mpi.m4
@@ -53,7 +53,6 @@ dnl -*- autoconf -*-
 
 AC_DEFUN([DUNE_MPI],[
   AC_PREREQ(2.50) dnl for AC_LANG_CASE
-  AC_REQUIRE([DUNE_CPPINCLUDEOPT])
 
   # get compilation script
   AC_LANG_CASE([C],[
@@ -162,30 +161,22 @@ AC_DEFUN([DUNE_MPI],[
   ])
     
   # set flags
-  AS_IF([test yes = "$HAVE_CPPINCLUDEOPT"],
-    [dune_mpicppflagswarn="${CPPINCLUDEOPT}dune/common/warnings/mpi_cppflags_deprecation.hh"],
-    [dune_mpicppflagswarn=""])
   AS_IF([test "x$with_mpi" != "xno"],[
-    AC_SUBST(DUNEMPICPPFLAGS, $DUNEMPICPPFLAGS)
-    AC_SUBST(DUNEMPILDFLAGS, $DUNEMPILDFLAGS)
-    AC_SUBST(DUNEMPILIBS, $DUNEMPILIBS)
-
-    DUNE_DEPRECATED_CPPFLAGS(MPI_CPPFLAGS, "$dune_mpicppflagswarn $DUNEMPICPPFLAGS",
-      [The MPI_CPPFLAGS configure substitute is deprecated.  Please change your Makefile.am to use DUNEMPICPPFLAGS instead.  Note that it is a good idea to change any occurance of MPI_LDFLAGS into DUNEMPILIBS and DUNEMPILDFLAGS as apropriate, since it is not possible to issue a deprecation warning in that case.])
-    AC_SUBST(MPI_LDFLAGS, "$DUNEMPILDFLAGS $DUNEMPILIBS")
-    AC_SUBST(MPI_VERSION, $dune_MPI_VERSION)
+    MPI_LDFLAGS="$DUNEMPILDFLAGS $DUNEMPILIBS"
     AC_DEFINE(HAVE_MPI,ENABLE_MPI,[Define if you have the MPI library.
-    This is only true if MPI was found by configure _and_ if the application
-    uses the DUNEMPICPPFLAGS (or the deprecated MPI_CPPFLAGS)])
+      This is only true if MPI was found by configure _and_ if the application
+      uses the DUNEMPICPPFLAGS (or the deprecated MPI_CPPFLAGS)])
   ],[
-    AC_SUBST(DUNEMPICPPFLAGS, "")
-    AC_SUBST(DUNEMPILDFLAGS, "")
-    AC_SUBST(DUNEMPILIBS, "")
-
-    DUNE_DEPRECATED_CPPFLAGS(MPI_CPPFLAGS, "$dune_mpicppflagswarn",
-      [The MPI_CPPFLAGS configure substitute is deprecated.  Please change your Makefile.am to use DUNEMPICPPFLAGS instead.  Note that it is a good idea to change any occurance of MPI_LDFLAGS into DUNEMPILIBS and DUNEMPILDFLAGS as apropriate, since it is not possible to issue a deprecation warning in that case.])
-    AC_SUBST(MPI_LDFLAGS, "")
+    MPI_LDFLAGS=""
   ])
+  AC_SUBST(DUNEMPICPPFLAGS)
+  AC_SUBST(DUNEMPILDFLAGS)
+  AC_SUBST(DUNEMPILIBS)
+  AC_SUBST(MPI_VERSION, $dune_MPI_VERSION)
+
+  DUNE_DEPRECATED_CPPFLAGS(MPI_CPPFLAGS, "$DUNEMPICPPFLAGS",
+    [The MPI_CPPFLAGS configure substitute is deprecated.  Please change your Makefile.am to use DUNEMPICPPFLAGS instead.  Note that it is a good idea to change any occurance of MPI_LDFLAGS into DUNEMPILIBS and DUNEMPILDFLAGS as apropriate, since it is not possible to issue a deprecation warning in that case.])
+  AC_SUBST(MPI_LDFLAGS)
 
   AM_CONDITIONAL(MPI, [test "x$with_mpi" != "xno"])
 
-- 
GitLab