Commit cfc22b6f authored by Andreas Lauser's avatar Andreas Lauser
Browse files

autotools build: move the M4 macros out of configure.ac into m4/dumux.m4

also do some cleanups in the macros

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@5030 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 156a93ec
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
DUNE_AC_INIT # gets module version from dune.module file
DUNE_AC_INIT
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([test/decoupled/1p/test_diffusion.cc])
AC_CONFIG_SRCDIR([dumux/common/spline.hh])
AM_CONFIG_HEADER([config.h])
AC_CHECK_PROGS([TEX4HT], [tex4ht], [true])
AC_CHECK_PROGS([MK4HT], [mk4ht], [true])
AC_CHECK_PROGS([T4HT], [t4ht], [true])
AC_CHECK_PROGS([LATEX], [latex], [true])
AM_CONDITIONAL([TEX4HT], [test "x$TEX4HT" != xtrue])
AC_CHECK_PROGS([CONVERT], [convert], [false])
AM_CONDITIONAL([CONVERT], [test "x$CONVERT" != xfalse])
AM_CONDITIONAL([BUILD_HANDBOOK], [test -a "stamp-vc" -a "x$LATEX" != xtrue])
AC_CHECK_HEADER([valgrind/memcheck.h],
[HAVE_VALGRIND_H="1"],
AC_MSG_WARN([valgrind/memcheck.h not found]))
if test x"$HAVE_VALGRIND_H" = "x1"; then
AC_DEFINE(HAVE_VALGRIND,1,[Define whether the valgrind header files for client requests are present.])
fi
# we need no more than the standard DE-stuff
# this module depends on dune-pdelab
# this implies checking for [dune-common], [dune-grid], [dune-localfunctions], [dune-istl], [dune-pdelab]
DUNE_CHECK_ALL
DUMUX_CHECKS
# the Boost c++ template libraries
AX_BOOST_BASE([1.33.1])
AC_DEFUN([SET_PARDISO], [
AC_PREREQ(2.50)
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
acx_pardiso_ok=no
AC_ARG_WITH(pardiso,
[AC_HELP_STRING([--with-pardiso=<lib>], [use PARDISO library <lib>])])
case $with_pardiso in
yes | "") ;;
no) acx_pardiso_ok=disable ;;
-* | */* | *.a | *.so | *.so.* | *.o) PARDISO_LIBS="$with_pardiso" ;;
*) PARDISO_LIBS="-l$with_pardiso" ;;
esac
# Get fortran linker names of PARDISO functions to check for.
AC_F77_FUNC(pardisoinit)
acx_pardiso_save_LIBS="$LIBS"
LIBS="$BLAS_LIBS $LIBS $FLIBS"
# First, check PARDISO_LIBS environment variable
if test $acx_pardiso_ok = no; then
if test "x$PARDISO_LIBS" != x; then
save_LIBS="$LIBS"; LIBS="$PARDISO_LIBS $LIBS"
AC_MSG_CHECKING([for $pardisoinit in $PARDISO_LIBS])
AC_TRY_LINK_FUNC($pardisoinit, [acx_pardiso_ok=yes], [PARDISO_LIBS=""])
AC_MSG_RESULT($acx_pardiso_ok)
LIBS="$save_LIBS"
fi
fi
AC_SUBST(PARDISO_LIBS)
LIBS="$acx_pardiso_save_LIBS"
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pardiso_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PARDISO,1,[Define if you have a PARDISO library.]),[$1])
:
else
acx_pardiso_ok=no
$2
fi
])dnl SET_PARDISO
SET_PARDISO
# implicitly set the Dune-flags everywhere
AC_SUBST(AM_CPPFLAGS, "$ALL_PKG_CPPFLAGS" )
AC_SUBST(AM_LDFLAGS, "$ALL_PKG_LDFLAGS" )
LIBS="$DUNE_LIBS $ALL_PKG_LIBS $PARDISO_LIBS"
DUMUX_CHECK_ALL
AC_CONFIG_FILES([dumux.pc
Makefile
......@@ -153,8 +76,13 @@ AC_CONFIG_FILES([dumux.pc
tutorial/Makefile
])
# implicitly set the Dune-flags everywhere
AC_SUBST(AM_CPPFLAGS, "$ALL_PKG_CPPFLAGS" )
AC_SUBST(AM_LDFLAGS, "$ALL_PKG_LDFLAGS" )
LIBS="$DUNE_LIBS $ALL_PKG_LIBS"
AC_OUTPUT
# finally print the summary information
DUNE_SUMMARY_ALL
echo "Pardiso..........: $acx_pardiso_ok"
echo
DUMUX_SUMMARY_ALL
......@@ -3,10 +3,96 @@ dnl -*- autoconf -*-
# the macros in ${top_src_dir}/dependencies.m4, which is generated by
# "dunecontrol autogen"
# the SET_PARDISO macro moved to dune-common as of dune 2.0!
dnl AC_DEFUN([SET_PARDISO], [
dnl AC_PREREQ(2.50)
dnl AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
dnl acx_pardiso_ok=no
dnl AC_ARG_WITH(pardiso,
dnl [AC_HELP_STRING([--with-pardiso=<lib>], [use PARDISO library <lib>])])
dnl case $with_pardiso in
dnl yes | "") ;;
dnl no) acx_pardiso_ok=disable ;;
dnl -* | */* | *.a | *.so | *.so.* | *.o) PARDISO_LIBS="$with_pardiso" ;;
dnl *) PARDISO_LIBS="-l$with_pardiso" ;;
dnl esac
dnl # Get fortran linker names of PARDISO functions to check for.
dnl AC_F77_FUNC(pardisoinit)
dnl acx_pardiso_save_LIBS="$LIBS"
dnl LIBS="$BLAS_LIBS $LIBS $FLIBS"
dnl # First, check PARDISO_LIBS environment variable
dnl if test $acx_pardiso_ok = no; then
dnl if test "x$PARDISO_LIBS" != x; then
dnl save_LIBS="$LIBS"; LIBS="$PARDISO_LIBS $LIBS"
dnl AC_MSG_CHECKING([for $pardisoinit in $PARDISO_LIBS])
dnl AC_TRY_LINK_FUNC($pardisoinit, [acx_pardiso_ok=yes], [PARDISO_LIBS=""])
dnl AC_MSG_RESULT($acx_pardiso_ok)
dnl LIBS="$save_LIBS"
dnl fi
dnl fi
dnl AC_SUBST(PARDISO_LIBS)
dnl LIBS="$acx_pardiso_save_LIBS"
dnl # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
dnl if test x"$acx_pardiso_ok" = xyes; then
dnl ALL_PKG_LIBS="$ALL_PKG_LIBS $PARDISO_LIBS"
dnl ifelse([$1],,AC_DEFINE(HAVE_PARDISO,1,[Define if you have a PARDISO library.]),[$1])
dnl :
dnl else
dnl acx_pardiso_ok=no
dnl $2
dnl fi
dnl DUNE_ADD_SUMMARY_ENTRY([Pardiso],[$acx_pardiso_ok])
dnl ]) # SET_PARDISO
# Additional checks needed to build dumux
# This macro should be invoked by every module which depends on dumux, as
# well as by dumux itself
AC_DEFUN([DUMUX_CHECKS])
AC_DEFUN([DUMUX_CHECKS],
[
if test x"$HAVE_VALGRIND_H" = "x1"; then
AC_DEFINE(HAVE_VALGRIND,1,[Define whether the valgrind header files for client requests are present.])
fi
AC_CHECK_PROGS([TEX4HT], [tex4ht], [true])
AC_CHECK_PROGS([MK4HT], [mk4ht], [true])
AC_CHECK_PROGS([T4HT], [t4ht], [true])
AC_CHECK_PROGS([LATEX], [latex], [true])
AM_CONDITIONAL([TEX4HT], [test "x$TEX4HT" != xtrue])
AC_CHECK_PROGS([CONVERT], [convert], [false])
AM_CONDITIONAL([CONVERT], [test "x$CONVERT" != xfalse])
AM_CONDITIONAL([BUILD_HANDBOOK], [test -a "stamp-vc" -a "x$LATEX" != xtrue])
AC_CHECK_HEADER([valgrind/memcheck.h],
[HAVE_VALGRIND_H="1"],
AC_MSG_WARN([valgrind/memcheck.h not found]))
# the Boost c++ template libraries
AX_BOOST_BASE([1.33.1])
# check whether pardiso is installed (this is already in dune-common
# so we only use the results.)
# SET_PARDISO
DUNE_ADD_SUMMARY_ENTRY([Pardiso],[$acx_pardiso_ok])
])
AC_DEFUN([DUMUX_CHECK_ALL],
[
DUNE_CHECK_ALL
])
AC_DEFUN([DUMUX_SUMMARY_ALL],
[
DUNE_SUMMARY_ALL
])
# DUMUX_CHECK_MODULES(NAME, HEADER, SYMBOL)
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment