Skip to content
Snippets Groups Projects
Commit ee354ce3 authored by Christian Engwer's avatar Christian Engwer
Browse files

improved buildsystem ... dune-disc works now

[[Imported from SVN: r4501]]
parent aef6f3c3
No related branches found
No related tags found
No related merge requests found
...@@ -149,6 +149,7 @@ run_default_list () { echo -n; } ...@@ -149,6 +149,7 @@ run_default_list () { echo -n; }
run_default_update () { echo "WARNING: Doing nothing"; } run_default_update () { echo "WARNING: Doing nothing"; }
run_default_autogen () { run_default_autogen () {
PARAMS="$CMD_PARAMS"
if test -x autogen.sh; then if test -x autogen.sh; then
for m in $MODULES; do for m in $MODULES; do
path=$(eval "echo \$PATH_$m") path=$(eval "echo \$PATH_$m")
...@@ -161,6 +162,7 @@ run_default_autogen () { ...@@ -161,6 +162,7 @@ run_default_autogen () {
} }
run_default_configure () { run_default_configure () {
PARAMS="$CMD_PARAMS"
if test -x configure; then if test -x configure; then
if test "x$HAVE_dune_common" == "xyes"; then if test "x$HAVE_dune_common" == "xyes"; then
PARAMS="$PARAMS \"--with-dunecommon=$PATH_dune_common\"" PARAMS="$PARAMS \"--with-dunecommon=$PATH_dune_common\""
...@@ -172,7 +174,7 @@ run_default_configure () { ...@@ -172,7 +174,7 @@ run_default_configure () {
PARAMS="$PARAMS \"--with-duneistl=$PATH_dune_istl\"" PARAMS="$PARAMS \"--with-duneistl=$PATH_dune_istl\""
fi fi
if test "x$HAVE_dune_disc" == "xyes"; then if test "x$HAVE_dune_disc" == "xyes"; then
PARAMS="$PARAMS \"--with-dunecommon=$PATH_dune_disc\"" PARAMS="$PARAMS \"--with-dunedisc=$PATH_dune_disc\""
fi fi
echo ./configure "$PARAMS" echo ./configure "$PARAMS"
eval ./configure "$PARAMS" eval ./configure "$PARAMS"
...@@ -186,6 +188,7 @@ run_default_configure () { ...@@ -186,6 +188,7 @@ run_default_configure () {
} }
run_default_make () { run_default_make () {
PARAMS="$CMD_PARAMS"
echo make "$PARAMS"; echo make "$PARAMS";
eval make "$PARAMS"; eval make "$PARAMS";
} }
...@@ -237,10 +240,10 @@ command=$1 ...@@ -237,10 +240,10 @@ command=$1
shift shift
if test "x$1" != "x"; then if test "x$1" != "x"; then
PARAMS="$PARAMS \"$1\"" CMD_PARAMS="$PARAMS \"$1\""
while shift; do while shift; do
if test "x$1" != "x"; then if test "x$1" != "x"; then
PARAMS="$PARAMS \"$1\"" CMD_PARAMS="$PARAMS \"$1\""
fi fi
done done
fi fi
......
...@@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libcommon.la ...@@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libcommon.la
libcommon_la_SOURCES = stdstreams.cc configparser.cc exprtmpl.cc libcommon_la_SOURCES = stdstreams.cc configparser.cc exprtmpl.cc
AM_CPPFLAGS = -I$(top_srcdir)/.. AM_CPPFLAGS = @AN_CPPFLAGS@ -I$(top_srcdir)/..
commonincludedir = $(includedir)/dune/common commonincludedir = $(includedir)/dune/common
commoninclude_HEADERS = dlist.cc stdstreams.cc alignment.hh \ commoninclude_HEADERS = dlist.cc stdstreams.cc alignment.hh \
......
...@@ -26,6 +26,11 @@ int main () { ...@@ -26,6 +26,11 @@ int main () {
Dune::derr << "Teststring" << std::endl; Dune::derr << "Teststring" << std::endl;
Dune::derr << VALUE << std::endl; Dune::derr << VALUE << std::endl;
Dune::dverb << VALUE << std::endl;
Dune::dvverb << VALUE << std::endl;
Dune::dinfo << VALUE << std::endl;
Dune::dwarn << VALUE << std::endl;
Dune::dgrave << VALUE << std::endl;
// instantiate private stream and connect global stream // instantiate private stream and connect global stream
{ {
......
#! /bin/bash #! /bin/bash
# $Id$ # $Id$
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_INIT(dune, 0.0, dune@hal.iwr.uni-heidelberg.de) AC_INIT(dune-common, 0.0, dune@hal.iwr.uni-heidelberg.de)
AM_INIT_AUTOMAKE(dune, 0.0, dune@hal.iwr.uni-heidelberg.de) AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([common/stdstreams.cc]) AC_CONFIG_SRCDIR([common/stdstreams.cc])
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
# check all dune-module stuff # check all dune-module stuff
DUNE_CHECK_ALL_M DUNE_CHECK_ALL_M([dunecommon])
if test x$HAVE_DUNECOMMON != x1 ; then if test x$HAVE_DUNECOMMON != x1 ; then
AC_MSG_ERROR([Can't work without the dune-common module. Maybe you have to supply your dune-common directory as --with-dunecommon=dir]) AC_MSG_ERROR([Can't work without the dune-common module. Maybe you have to supply your dune-common directory as --with-dunecommon=dir])
fi fi
# preset variable to path such that #include <dune/...> works # preset variable to path such that #include <dune/...> works
AC_SUBST([AM_CPPFLAGS], '$(DUNECOMMON_CPPFLAGS)') AC_SUBST([AM_CPPFLAGS], '-I$(top_srcdir)')
AC_SUBST([LIBDUNE], '$(DUNECOMMONROOT)/common/libcommon.la') AC_SUBST([LIBDUNE], '$(top_builddir)/common/libcommon.la')
DUNE_SUMMARY_ALL DUNE_SUMMARY_ALL
......
...@@ -15,6 +15,8 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -15,6 +15,8 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
# ____DUNE_CHECK_MODULES_____ ($1) # ____DUNE_CHECK_MODULES_____ ($1)
echo checking for $1
AC_DEFUN([_dune_module], [$1]) AC_DEFUN([_dune_module], [$1])
AC_DEFUN([_dune_header], [$2]) AC_DEFUN([_dune_header], [$2])
AC_DEFUN([_dune_ldpath], [$3]) AC_DEFUN([_dune_ldpath], [$3])
...@@ -43,17 +45,19 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -43,17 +45,19 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
_DUNE_MODULE[]ROOT=`cd $withval && pwd` _DUNE_MODULE[]ROOT=`cd $withval && pwd`
# expand search path (otherwise empty CPPFLAGS) # expand search path (otherwise empty CPPFLAGS)
CPPFLAGS="-I$_DUNE_MODULE[]ROOT" _DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]ROOT"
else else
AC_MSG_ERROR([_dune_module-directory $withval does not exist]) AC_MSG_ERROR([_dune_module-directory $withval does not exist])
fi fi
fi fi
CPPFLAGS="$DUNE_CPPFLAGS $_DUNE_MODULE[]_CPPFLAGS"
# test for an arbitrary header # test for an arbitrary header
AC_CHECK_HEADER([dune/[]_dune_header], AC_CHECK_HEADER([dune/[]_dune_header],
[HAVE_[]_DUNE_MODULE=1 [HAVE_[]_DUNE_MODULE=1
_DUNE_MODULE[]_CPPFLAGS="$CPPFLAGS"], _DUNE_MODULE[]_CPPFLAGS="$CPPFLAGS"],
[HAVE_[]_DUNE_MODULE=0 [HAVE_[]_DUNE_MODULE=0
_DUNE_MODULE[]_CPPFLAGS=""
AC_MSG_ERROR([$withval does not seem to contain a valid _dune_module (dune/[]_dune_header not found)])] AC_MSG_ERROR([$withval does not seem to contain a valid _dune_module (dune/[]_dune_header not found)])]
) )
...@@ -105,11 +109,17 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -105,11 +109,17 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
# did we succeed? # did we succeed?
if test x$HAVE_[]_DUNE_MODULE = x1 ; then if test x$HAVE_[]_DUNE_MODULE = x1 ; then
# set variables for our modules
AC_SUBST(_DUNE_MODULE[]_CPPFLAGS, "$_DUNE_MODULE[]_CPPFLAGS") AC_SUBST(_DUNE_MODULE[]_CPPFLAGS, "$_DUNE_MODULE[]_CPPFLAGS")
AC_SUBST(_DUNE_MODULE[]_LDFLAGS, "$_DUNE_MODULE[]_LDFLAGS") AC_SUBST(_DUNE_MODULE[]_LDFLAGS, "$_DUNE_MODULE[]_LDFLAGS")
AC_SUBST(_DUNE_MODULE[]_LIBS, "$_DUNE_MODULE[]_LIBS") AC_SUBST(_DUNE_MODULE[]_LIBS, "$_DUNE_MODULE[]_LIBS")
AC_SUBST(_DUNE_MODULE[]ROOT, "$_DUNE_MODULE[]ROOT") AC_SUBST(_DUNE_MODULE[]ROOT, "$_DUNE_MODULE[]ROOT")
AC_DEFINE(HAVE_[]_DUNE_MODULE, 1, [Define to 1 if _dune_module was found]) AC_DEFINE(HAVE_[]_DUNE_MODULE, 1, [Define to 1 if _dune_module was found])
# set DUNE_* variables
AC_SUBST(DUNE_CPPFLAGS, "$DUNE_CPPFLAGS $_DUNE_MODULE[]_CPPFLAGS")
AC_SUBST(DUNE_LDFLAGS, "$DUNE_LDFLAGS $_DUNE_MODULE[]_LDFLAGS")
AC_SUBST(DUNE_LIBS, "$DUNE_LIBS $_DUNE_MODULE[]_LIBS")
# add to global list # add to global list
DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $DUNE_CPPFLAGS" DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $DUNE_CPPFLAGS"
...@@ -125,11 +135,17 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -125,11 +135,17 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
AC_LANG_POP([C++]) AC_LANG_POP([C++])
]) ])
AC_DEFUN([DUNE_ALL_MODULES],[ AC_DEFUN([DUNE_CHECK_DISPATCH],[
echo checking for dunecommon ifelse([$1], [], [],
DUNE_CHECK_MODULES([dunecommon], [common/stdstreams.hh], [common], [common], [Dune::derr.active();]) [$1], [dunecommon],[
echo checking for duneistl DUNE_CHECK_MODULES([dunecommon], [common/stdstreams.hh], [common], [common], [Dune::derr.active();])],
DUNE_CHECK_MODULES([duneistl], [istl/allocator.hh],,,) [$1], [dunegrid],[
DUNE_CHECK_MODULES([dunegrid], [grid/common/grid.hh], [grid], [grid], [Dune::PartitionName])],
[$1], [duneistl],[
DUNE_CHECK_MODULES([duneistl], [istl/allocator.hh],,,)],
[$1], [dunedist],[
DUNE_CHECK_MODULES([dunedisc], [disc/functions/functions.hh], [disc], [disc], [Dune::LagrangeShapeFunctions<double, double, 3>::general])],
[AC_MSG_ERROR([Unknown module $1])])
]) ])
AC_DEFUN([DUNE_DEV_MODE],[ AC_DEFUN([DUNE_DEV_MODE],[
...@@ -141,6 +157,10 @@ AC_DEFUN([DUNE_DEV_MODE],[ ...@@ -141,6 +157,10 @@ AC_DEFUN([DUNE_DEV_MODE],[
fi fi
]) ])
AC_DEFUN([DUNE_MODULE_DEPENDENCIES],[
ifelse($#, 0, , $#, 1, [DUNE_CHECK_DISPATCH($1)], [DUNE_CHECK_DISPATCH($1) DUNE_MODULE_DEPENDENCIES(m4_shift($@))])
])
AC_DEFUN([DUNE_SYMLINK],[ AC_DEFUN([DUNE_SYMLINK],[
# create symlink for consistent paths even when $(top_srcdir) is not # create symlink for consistent paths even when $(top_srcdir) is not
# called dune/ (if filesystem/OS supports symlinks) # called dune/ (if filesystem/OS supports symlinks)
......
...@@ -44,7 +44,8 @@ dnl check for library functions ...@@ -44,7 +44,8 @@ dnl check for library functions
AC_LANG_POP([C++]) AC_LANG_POP([C++])
dnl check all components dnl check all components
AC_REQUIRE([DUNE_ALL_MODULES]) AC_REQUIRE([DUNE_MODULE_DEPENDENCIES])
DUNE_MODULE_DEPENDENCIES($@)
# AC_REQUIRE([DUNE_PATH_DUNE]) # AC_REQUIRE([DUNE_PATH_DUNE])
AC_REQUIRE([DUNE_PATH_XDR]) AC_REQUIRE([DUNE_PATH_XDR])
AC_REQUIRE([DUNE_PATH_GRAPE]) AC_REQUIRE([DUNE_PATH_GRAPE])
...@@ -168,8 +169,14 @@ AC_ARG_WITH(revision, ...@@ -168,8 +169,14 @@ AC_ARG_WITH(revision,
[revision to use for automated test runs])) [revision to use for automated test runs]))
if test "x$with_revision" = "xno" ; then with_revision=bar; fi if test "x$with_revision" = "xno" ; then with_revision=bar; fi
AC_SUBST(revision, $with_revision) AC_SUBST(revision, $with_revision)
AC_LANG_PUSH([C++])
AC_REQUIRE([DUNE_MODULE_DEPENDENCIES])
echo "Resolving Dependencies: $@"
echo "Resolving Dependencies: shift($@)"
DUNE_MODULE_DEPENDENCIES($@)
AC_REQUIRE([DUNE_CHECK_ALL]) AC_REQUIRE([DUNE_CHECK_ALL])
AC_REQUIRE([DUNE_DEV_MODE]) AC_REQUIRE([DUNE_DEV_MODE])
AC_LANG_POP([C++])
]) ])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment