opm-core/m4/ax_dune_istl.m4
Bård Skaflestad 05410ac950 Always #define "HAVE_DUNE_ISTL".
Define the symbol to zero (false) if unavailable.  This prevents a
diagnostic message concerning an undefined preprocessor symbol when used
in the form

    #if HAVE_DUNE_ISTL
       /* ... */
    #endif
2012-08-14 12:49:56 +02:00

42 lines
1.2 KiB
Plaintext

AC_DEFUN([OPM_DUNE_ISTL_PROGRAM_TEXT],
[AC_LANG_PROGRAM(
[[#include <dune/common/deprecated.hh>
#include <dune/istl/bcrsmatrix.hh>
#include <dune/common/fmatrix.hh>
]],dnl
[[typedef Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > Matrix;
Matrix matrix( 3, 3, Matrix::random );
for (int i = 0; i < 3; ++i) matrix.setrowsize(i, 2);
matrix.endrowsizes();
]])[]dnl
])
AC_DEFUN([AX_DUNE_ISTL],
[AC_REQUIRE([AX_DUNE_COMMON])
AC_CACHE_CHECK(dnl
[for installed dune-istl headers],dnl
[ax_cv_dune_istl_available],dnl
[AC_LANG_PUSH([C++])[]dnl
AC_LINK_IFELSE([OPM_DUNE_ISTL_PROGRAM_TEXT],dnl
[ax_cv_dune_istl_available=yes],dnl
[ax_cv_dune_istl_available=no])
AC_LANG_POP([C++])[]dnl
])[]dnl
AS_IF([test "x$ax_cv_dune_istl_available" = "xyes" -a \
"x$ax_cv_dune_common_available" = "xyes"],dnl
[AC_DEFINE([HAVE_DUNE_ISTL], [1],dnl
[Define to 1 if `dune-istl' is available])
],dnl
[AC_DEFINE([HAVE_DUNE_ISTL], [0],dnl
[Define to 0 if `dune-istl' is unavailable.])])[]dnl
AM_CONDITIONAL([DUNE_ISTL],
[test "x$ax_cv_dune_istl_available" = "xyes" -a \
"x$ax_cv_dune_common_available" = "xyes"])
])