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

updated buildsystem ... dune-grid works now

[[Imported from SVN: r4500]]
parent 61e971e0
No related branches found
No related tags found
No related merge requests found
......@@ -14,4 +14,6 @@ semantic.cache
configure.lineno
stamp-h1
dune-*.tar.gz
dune-?.?
\ No newline at end of file
dune-?.?
ltmain.sh
dune
......@@ -72,13 +72,14 @@ eval_control() {
if test -f "$file"; then
# open subshell
(
set -e
# load functions defined in $file
# if $command is not defined in $file,
# then the default implementation will be executed
eval "$(grep -v -e '^[[:alnum:]]\+:' $file)"
# execute $command
$command "$@"
)
) || false
fi
}
......@@ -91,14 +92,14 @@ _build_module() {
# resolve dependencies
for dep in $(eval "echo \$DEPS_$module"); do
echo "--- $module depends on $dep ... calling ---"
(_build_module $command $dep "$@")
(set -e; _build_module $command $dep "$@") || false
done
# resolve suggestions
for dep in $(eval "echo \$SUGS_$module"); do
echo -n "--- $module suggests $dep ... "
if test "x$(eval echo \$HAVE_$dep)" != "x"; then
echo "calling ---"
(_build_module $command $dep "$@")
(set -e; _build_module $command $dep "$@") || false
else
echo "skipping ---"
fi
......@@ -107,9 +108,10 @@ _build_module() {
echo "--- calling $command for $module ---"
path=$(eval "echo \$PATH_${module}")
(
set -e
cd "$path"
eval_control $command $path/$CONTROL "$@"
)
) || false
export BUILD_DONE_${command}_${module}=yes
else
echo "--- skipping $module ---"
......@@ -142,11 +144,11 @@ usage () {
COMMANDS="update autogen configure make all"
run_list () { echo -n; }
run_default_list () { echo -n; }
run_update () { echo "WARNING: Doing nothing"; }
run_default_update () { echo "WARNING: Doing nothing"; }
run_autogen () {
run_default_autogen () {
if test -x autogen.sh; then
for m in $MODULES; do
path=$(eval "echo \$PATH_$m")
......@@ -158,7 +160,7 @@ run_autogen () {
fi
}
run_configure () {
run_default_configure () {
if test -x configure; then
if test "x$HAVE_dune_common" == "xyes"; then
PARAMS="$PARAMS \"--with-dunecommon=$PATH_dune_common\""
......@@ -172,6 +174,7 @@ run_configure () {
if test "x$HAVE_dune_disc" == "xyes"; then
PARAMS="$PARAMS \"--with-dunecommon=$PATH_dune_disc\""
fi
echo ./configure "$PARAMS"
eval ./configure "$PARAMS"
else
if test -f configure.in || test -f configure.ac; then
......@@ -182,28 +185,54 @@ run_configure () {
fi
}
run_make () {
run_default_make () {
echo make "$PARAMS";
eval make "$PARAMS";
}
run_all () {
run_default_all () {
run_autogen "$@"
run_configure "$@"
run_make "$@"
}
run_list () {
run_default_list "$@"
}
run_update () {
run_default_update "$@"
}
run_autogen () {
run_default_autogen "$@"
}
run_configure () {
run_default_configure "$@"
}
run_make () {
run_default_make "$@"
}
run_all () {
run_default_all "$@"
}
###############################################
#
# main
#
onfailure() {
echo Execution terminated due to errors!
exit 1
}
if test "x$1" == "x"; then
usage
exit 1
fi
trap onfailure EXIT
command=$1
shift
......@@ -227,8 +256,10 @@ case "$command" in
*)
echo "ERROR: unknown command \"$command\""
usage
false
exit 1
;;
esac
exit 0
trap - EXIT
echo done
......@@ -55,6 +55,7 @@ settest_DEPENDENCIES = $(LIBDUNE)
gcdlcdtest_SOURCES = gcdlcdtest.cc
gcdlcdtest_DEPENDENCIES = $(LIBDUNE)
sourcescheck_NOSOURCES = exprtmpl.cc
# bin_PROGRAMS = exprtmpl timing_old timing_xpr timing_flt
#
exprtmpl_SOURCES = exprtmpl.cc
......
......@@ -6,166 +6,19 @@ AM_INIT_AUTOMAKE(dune, 0.0, dune@hal.iwr.uni-heidelberg.de)
AC_CONFIG_SRCDIR([common/stdstreams.cc])
AM_CONFIG_HEADER([config.h])
# do almost nothing, an application using Dune should provide the
# checks (use the macro provided in m4/dune.m4 to do this)
# check all dune-module stuff
DUNE_CHECK_ALL_M
# Checks for programs.
AC_PROG_CXX
AC_LANG_PUSH([C++])
# don't build shared libs per default, this is way better for debugging...
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
DUNE_CHECK_COMPILER
DUNE_LINKCXX
# how to create a deprecated warning
DUNE_CHECKDEPRECATED
# check for auxiliary tools so that it's not fatal if they're missing
AC_CHECK_PROGS([DOXYGEN], [doxygen], [true])
AC_CHECK_PROGS([TEX], [latex], [true])
AC_CHECK_PROGS([BIBTEX], [bibtex], [true])
AC_CHECK_PROGS([DVIPDF], [dvipdf], [true])
AC_CHECK_PROGS([DVIPS], [dvips], [true])
AC_CHECK_PROGS([WML], [wml], [true])
AM_CONDITIONAL([WML], [test "x$WML" != xtrue])
AC_CHECK_PROGS([PERL], [perl], [true])
DUNE_INKSCAPE
AC_CHECK_PROGS([CONVERT], [convert], [true])
# doxygen and latex take a lot of time...
AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--disable-documentation],[don't generate docs, speeds up the build]))
AM_CONDITIONAL(BUILD_DOCS, test x$enable_documentation != xno)
# special variable to include the documentation into the website
AC_ARG_WITH(duneweb,
AC_HELP_STRING([--with-duneweb=PATH],[Only needed for website-generation, path to checked out version of dune-web]))
if test x$with_duneweb != x ; then
# parameter is set. Check it
AC_MSG_CHECKING([whether passed Dune-Web directory appears correct])
WEBTESTFILE="$with_duneweb/layout/default.wml"
if test -d "$with_duneweb" && test -e "$WEBTESTFILE" ; then
AC_MSG_RESULT([ok])
# normalize path
with_duneweb=`(cd $with_duneweb && pwd)` ;
else
if test -d "$with_duneweb" ; then
AC_MSG_ERROR([$WEBTESTFILE not found in Dune-web dir $with_duneweb!])
else
AC_MSG_ERROR([Dune-Web directory $with_duneweb not found!])
fi
fi
fi
AC_SUBST(DUNEWEBDIR, $with_duneweb)
# special settings for check-log
AC_ARG_WITH(hostid,
AC_HELP_STRING([--with-hostid=HOST_IDENTIFIER],
[host identifier used for automated test runs]))
if test "x$with_hostid" = "xno" ; then
with_hostid="$ac_hostname ($(uname -sm), $COMPILER_NAME)";
fi
AC_SUBST(host, $with_hostid)
AC_ARG_WITH(tag,
AC_HELP_STRING([--with-tag=TAG],
[tag to use for automated test runs]))
if test "x$with_tag" = "xno" ; then with_tag=foo; fi
AC_SUBST(tag, $with_tag)
AC_ARG_WITH(revision,
AC_HELP_STRING([--with-revision=TAG],
[revision to use for automated test runs]))
if test "x$with_revision" = "xno" ; then with_revision=bar; fi
AC_SUBST(revision, $with_revision)
echo
echo Checking for libraries the self-test could use:
echo
# -- check for other grid-libs so that they may be included into tests
DUNE_PATH_GRAPE
# Alberta-check
DUNE_PATH_ALBERTA
# UG-check
DUNE_PATH_UG
# Check for the AmiraMesh library
DUNE_PATH_AMIRAMESH
# Check for the psurface library
DUNE_PATH_PSURFACE
# Yaspgrid-check
DUNE_MPI
# check for ALUGrid (needs MPI to build parallel version)
DUNE_PATH_ALUGRID
# check for Metis
IMMDX_LIB_METIS(,AC_MSG_WARN([METIS not found]))
# check for ParMETIS
DUNE_PATH_PARMETIS
#check for blas
ACX_BLAS(AC_MSG_WARN(,[BLAS not found]))
# check for superlu
DUNE_PATH_SUPERLU
DUNE_PATH_SUPERLU_DIST
# create symlink for consistent paths even when $(top_srcdir) is not
# called dune/ (if filesystem/OS supports symlinks)
AC_PROG_LN_S
if test x"$LN_S" = x"ln -s" ; then
# Symlinks possible!
# Note: we are currently in the build directory which may be != the
# source directory
# does a file already exist?
if test -e dune ; then
# exists: is a symlink?
if test -L dune ; then
if test -r dune/$ac_unique_file ; then
# suppose that the link is ok and use it
AM_CPPFLAGS='-I$(top_builddir)';
else
AC_MSG_ERROR([Symlink 'dune' exists but appears to be wrong! Please remove it manually])
fi
fi
else
echo Creating dune-symlink...
# set symlink in build directory to sources
ln -s $srcdir dune
# sanity check
if test -r dune/$ac_unique_file ; then
AM_CPPFLAGS='-I$(top_builddir)';
else
AC_MSG_ERROR([Sanity check for symlink failed! Please send a bugreport to dune@hal.iwr.uni-heidelberg.de])
fi
# set proper include-path
AM_CPPFLAGS='-I$(top_builddir)';
fi
else
# no symlinks possible... check name of directory
# does dune-dir above exist and is it this directory?
if test -d ../dune && test `pwd` = `( cd ../dune && pwd)` ; then
DIR=`(cd .. && pwd)`;
# use directory above current dir in include-path
AM_CPPFLAGS="-I$DIR";
else
AC_MSG_ERROR([No symlinks supported! You have to rename the current directory to the name 'dune'])
fi
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])
fi
# preset variable to path such that #include <dune/...> works
AC_SUBST(AM_CPPFLAGS)
AC_SUBST([AM_CPPFLAGS], '$(DUNECOMMON_CPPFLAGS)')
AC_SUBST([LIBDUNE], '$(DUNECOMMONROOT)/common/libcommon.la')
AC_SUBST(LIBDUNE, "\$(top_builddir)/common/libcommon.la")
AC_SUBST(DUNECOMMONROOT, "\$(top_srcdir)")
DUNE_SUMMARY_ALL
echo
echo Note: Most of the libraries checked for above are only used for the self-test
......
# Important: module names aren't allowed to have '-' characters
Module: dune_common
Suggests: UG Alberta Alu3d
run_configure () {
echo HUHU
if test "x$HAVE_UG" == "xyes"; then
PARAMS="$PARAMS \"--with-ug=$PATH_UG\""
fi
if test "x$HAVE_Alberta" == "xyes"; then
PARAMS="$PARAMS \"--with-alberta=$PATH_Alberta\""
fi
if test "x$HAVE_Alu3d" == "xyes"; then
PARAMS="$PARAMS \"--with-alberta=$PATH_Alu3d\""
fi
eval "./configure $PARAMS"
}
......@@ -15,12 +15,12 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
# ____DUNE_CHECK_MODULES_____ ($1)
m4_define(_dune_module,$1)
m4_define(_DUNE_MODULE,m4_toupper($1))
m4_define(_dune_header,$2)
m4_define(_dune_ldpath,$3)
m4_define(_dune_lib,$3)
m4_define(_dune_symbol,$4)
AC_DEFUN([_dune_module], [$1])
AC_DEFUN([_dune_header], [$2])
AC_DEFUN([_dune_ldpath], [$3])
AC_DEFUN([_dune_lib], [$4])
AC_DEFUN([_dune_symbol], [$5])
AC_DEFUN([_DUNE_MODULE], [m4_toupper(_dune_module)])
# switch tests to c++
AC_LANG_PUSH([C++])
......@@ -36,7 +36,7 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
LIBS=""
# is a directory set?
if test $withval != x ; then
if test x$withval != x ; then
# expand tilde
if test -d $withval ; then
# expand tilde / other stuff
......@@ -50,14 +50,15 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
fi
# test for an arbitrary header
AC_CHECK_HEADER([dune/_dune_header],
AC_CHECK_HEADER([dune/[]_dune_header],
[HAVE_[]_DUNE_MODULE=1
_DUNE_MODULE[]_CPPFLAGS="$CPPFLAGS"],
[HAVE_[]_DUNE_MODULE=0]
[HAVE_[]_DUNE_MODULE=0
AC_MSG_ERROR([$withval does not seem to contain a valid _dune_module (dune/[]_dune_header not found)])]
)
## check for lib (if lib name was provided)
ifelse(_dune_lib,,,[
ifelse(_dune_lib,,[echo _dune_module does not provide libs],[
# did we find the headers?
if test x$HAVE[]_DUNE_MODULE = x1 ; then
ac_save_LDFLAGS="$LDFLAGS"
......@@ -76,6 +77,8 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
# provide arguments like normal lib-check
_DUNE_MODULE[]_LIBS="-l[]_dune_lib"
HAVE_[]_DUNE_MODULE=1
else
AC_MSG_ERROR([$withval does not seem to contain a valid _dune_module (lib[]_dune_lib[].la not found)])
fi
fi
......@@ -89,7 +92,8 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
AC_TRY_LINK(,_dune_symbol,
[HAVE_[]_DUNE_MODULE=1
_DUNE_MODULE[]_LIBS="$LIBS"],
[HAVE_[]_DUNE_MODULE=0]
[HAVE_[]_DUNE_MODULE=0
AC_MSG_ERROR([failed to link with lib[]_dune_lib[].la])]
)
fi
......@@ -101,11 +105,11 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
# did we succeed?
if test x$HAVE_[]_DUNE_MODULE = x1 ; then
AC_SUBST(_DUNE_MODULE[]_CPPFLAGS, $_DUNE_MODULE_[]_CPPFLAGS)
AC_SUBST(_DUNE_MODULE[]_LDFLAGS, $_DUNE_MODULE[]_LDFLAGS)
AC_SUBST(_DUNE_MODULE[]_LIBS, $_DUNE_MODULE[]_LIBS)
AC_SUBST(_DUNE_MODULE[]_CPPFLAGS, "$_DUNE_MODULE[]_CPPFLAGS")
AC_SUBST(_DUNE_MODULE[]_LDFLAGS, "$_DUNE_MODULE[]_LDFLAGS")
AC_SUBST(_DUNE_MODULE[]_LIBS, "$_DUNE_MODULE[]_LIBS")
AC_SUBST(_DUNE_MODULE[]ROOT, "$_DUNE_MODULE[]ROOT")
AC_DEFINE(HAVE_[]_DUNE_MODULE, 1, [Define to 1 if _dune_module was found])
AC_SUBST(_DUNE_MODULE[]ROOT, $_DUNE_MODULE[]ROOT)
# add to global list
DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $DUNE_CPPFLAGS"
......@@ -122,8 +126,10 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
])
AC_DEFUN([DUNE_ALL_MODULES],[
echo checking for dunecommon
DUNE_CHECK_MODULES([dunecommon], [common/stdstreams.hh], [common], [common], [Dune::derr.active();])
DUNE_CHECK_MODULES([duneistl], [istl/allocator.hh])
echo checking for duneistl
DUNE_CHECK_MODULES([duneistl], [istl/allocator.hh],,,)
])
AC_DEFUN([DUNE_DEV_MODE],[
......@@ -134,3 +140,37 @@ AC_DEFUN([DUNE_DEV_MODE],[
AC_DEFINE(DUNE_DEVEL_MODE, 1, [Activates developer output])
fi
])
AC_DEFUN([DUNE_SYMLINK],[
# create symlink for consistent paths even when $(top_srcdir) is not
# called dune/ (if filesystem/OS supports symlinks)
AC_PROG_LN_S
if test x"$LN_S" = x"ln -s" ; then
# Symlinks possible!
# Note: we are currently in the build directory which may be != the
# source directory
# does a file already exist?
if test -e dune ; then
# exists: is a symlink?
if test -L dune ; then
if ! test -r dune/$ac_unique_file ; then
AC_MSG_ERROR([Symlink 'dune' exists but appears to be wrong! Please remove it manually])
fi
fi
else
echo Creating dune-symlink...
# set symlink in build directory to sources
ln -s $srcdir dune
# sanity check
if ! test -r dune/$ac_unique_file ; then
AC_MSG_ERROR([Sanity check for symlink failed! Please send a bugreport to dune@hal.iwr.uni-heidelberg.de])
fi
fi
else
# no symlinks possible... check name of directory
AC_MSG_ERROR([No symlinks supported! You have to install dune. No inplace usage possible!])
fi
])
\ No newline at end of file
......@@ -53,6 +53,7 @@ dnl check all components
AC_REQUIRE([DUNE_PATH_UG])
# AC_REQUIRE([DUNE_PATH_F5])
AC_REQUIRE([DUNE_PATH_AMIRAMESH])
AC_REQUIRE([DUNE_PATH_PSURFACE])
AC_REQUIRE([DUNE_MPI])
AC_REQUIRE([IMMDX_LIB_METIS])
AC_REQUIRE([DUNE_PATH_PARMETIS])
......@@ -78,6 +79,11 @@ AC_DEFUN([DUNE_SUMMARY_ALL],[
echo
echo "-----------------------------"
echo
echo "Dune-common......: $with_dunecommon"
echo "Dune-grid........: $with_dunegrid"
echo "Dune-istl........: $with_duneistl"
echo "Dune-disc........: $with_dunedisc"
echo "Dune-fem.........: $with_dunefem"
echo "Alberta..........: $with_alberta"
echo "ALUGrid..........: $with_alugrid"
echo "AmiraMesh........: $with_amiramesh"
......@@ -99,3 +105,71 @@ AC_DEFUN([DUNE_SUMMARY_ALL],[
echo
])
AC_DEFUN([DUNE_CHECK_ALL_M],[
AC_REQUIRE([DUNE_SYMLINK])
# don't build shared libs per default, this is way better for debugging...
AC_REQUIRE([AC_DISABLE_SHARED])
# check for auxiliary tools so that it's not fatal if they're missing
AC_CHECK_PROGS([DOXYGEN], [doxygen], [true])
AC_CHECK_PROGS([TEX], [latex], [true])
AC_CHECK_PROGS([BIBTEX], [bibtex], [true])
AC_CHECK_PROGS([DVIPDF], [dvipdf], [true])
AC_CHECK_PROGS([DVIPS], [dvips], [true])
AC_CHECK_PROGS([WML], [wml], [true])
AM_CONDITIONAL([WML], [test "x$WML" != xtrue])
AC_CHECK_PROGS([PERL], [perl], [true])
DUNE_INKSCAPE
AC_CHECK_PROGS([CONVERT], [convert], [true])
# doxygen and latex take a lot of time...
AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--disable-documentation],[don't generate docs, speeds up the build]))
AM_CONDITIONAL(BUILD_DOCS, test x$enable_documentation != xno)
# special variable to include the documentation into the website
AC_ARG_WITH(duneweb,
AC_HELP_STRING([--with-duneweb=PATH],[Only needed for website-generation, path to checked out version of dune-web]))
if test x$with_duneweb != x ; then
# parameter is set. Check it
AC_MSG_CHECKING([whether passed Dune-Web directory appears correct])
WEBTESTFILE="$with_duneweb/layout/default.wml"
if test -d "$with_duneweb" && test -e "$WEBTESTFILE" ; then
AC_MSG_RESULT([ok])
# normalize path
with_duneweb=`(cd $with_duneweb && pwd)` ;
else
if test -d "$with_duneweb" ; then
AC_MSG_ERROR([$WEBTESTFILE not found in Dune-web dir $with_duneweb!])
else
AC_MSG_ERROR([Dune-Web directory $with_duneweb not found!])
fi
fi
fi
AC_SUBST(DUNEWEBDIR, $with_duneweb)
# special settings for check-log
AC_ARG_WITH(hostid,
AC_HELP_STRING([--with-hostid=HOST_IDENTIFIER],
[host identifier used for automated test runs]))
if test "x$with_hostid" = "xno" ; then
with_hostid="$ac_hostname ($(uname -sm), $COMPILER_NAME)";
fi
AC_SUBST(host, $with_hostid)
AC_ARG_WITH(tag,
AC_HELP_STRING([--with-tag=TAG],
[tag to use for automated test runs]))
if test "x$with_tag" = "xno" ; then with_tag=foo; fi
AC_SUBST(tag, $with_tag)
AC_ARG_WITH(revision,
AC_HELP_STRING([--with-revision=TAG],
[revision to use for automated test runs]))
if test "x$with_revision" = "xno" ; then with_revision=bar; fi
AC_SUBST(revision, $with_revision)
AC_REQUIRE([DUNE_CHECK_ALL])
AC_REQUIRE([DUNE_DEV_MODE])
])
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