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

I made myself a late christmas present...

support for out-of-source builds in Dune.

You call dunecontrol with a parameter --builddir=NAME
dunecontrol will create a subdirectory NAME inside each 
module and do an out-of-source build there.

Not necessarily all modules support out-of-source, but at 
least common/istl did work.

[[Imported from SVN: r5813]]
parent b43e261b
No related branches found
No related tags found
No related merge requests found
......@@ -172,10 +172,8 @@ COMMANDS="update autogen configure make all exec status svn"
update_HELP="updated all modules from the repository"
autogen_HELP="run the autogen.sh script for each module"
configure_HELP="run configure for each module"
# "NOTE: the --with-dune* parameters will be generated by dunecontrol"
make_HELP="run make for each module"
all_HELP="\trun 'autogen', 'configure' and 'make' command for each module"
# "NOTE: run all for an initial setup"
exec_HELP="execute an arbitrary command in each module directory"
status_HELP="show vc status for all modules"
svn_HELP="\trun svn command for each svn managed module"
......@@ -312,14 +310,26 @@ run_default_configure () {
if test -d "$path/share/aclocal"; then
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $path/share/aclocal"
fi
PARAMS="$PARAMS \"--with-$name=$path\""
if test -d "$path/$BUILDDIR"; then
PARAMS="$PARAMS \"--with-$name=$path/$BUILDDIR\""
else
PARAMS="$PARAMS \"--with-$name=$path\""
fi
done
if test "x$HAVE_duneweb" == "xyes"; then
PARAMS="$PARAMS \"--with-duneweb=$PATH_duneweb\""
fi
PARAMS="$PARAMS ACLOCAL_AMFLAGS=\"$ACLOCAL_FLAGS\""
echo ./configure "$PARAMS"
eval ./configure "$PARAMS" || exit 1
# create build directory of requested
if test -n "$BUILDDIR"; then
test -d "$BUILDDIR" || mkdir "$BUILDDIR"
SRCDIR="$PWD"
cd "$BUILDDIR"
eval "$SRCDIR/configure" "$PARAMS" || exit 1
else
eval ./configure "$PARAMS" || exit 1
fi
else
if test -f configure.in || test -f configure.ac; then
echo "ERROR: configure.[in|ac] found, but configure missing." >&2
......@@ -334,6 +344,7 @@ run_default_configure () {
}
run_default_make () {
test ! -d "$BUILDDIR" || cd "$BUILDDIR"
PARAMS="$CMD_FLAGS"
echo make "$PARAMS"
eval $MAKE "$PARAMS"
......@@ -386,6 +397,8 @@ usage () {
echo " not built successfully on the previous run)"
echo " --opts=FILE load default options from FILE"
echo " (see dune-common/doc/example.opts)"
echo " --builddir=NAME make out-of-source builds in a subdir NAME."
echo " This directory is create inside each module."
echo " --[COMMAND]-opts=opts set options for COMMAND"
echo " (this is mainly useful for the all COMMAND)"
echo "COMMANDS:"
......@@ -507,6 +520,15 @@ while test $# -gt 0; do
export ONLY="$ONLY $MODULE"
done
;;
--builddir=*)
if test "x$arg" = "x"; then
usage
echo "ERROR: Parameter for --builddir is missing" >&2
echo >&2
exit 1;
fi
export BUILDDIR=$arg
;;
--skipversioncheck)
export SKIPVERSIONCHECK=yes
;;
......
......@@ -23,10 +23,10 @@ AC_DEFUN([DUNE_MODULE_ADD_SUMMARY_ENTRY],[
m4_pushdef([_DUNE_MODULE], [m4_toupper(_dune_module)])
result="$with_[]_dune_module"
AS_IF([test -n "$_DUNE_MODULE[]_ROOT"],[
result="$result ($_DUNE_MODULE[]_ROOT)"
result="$result ($_DUNE_MODULE[]_ROOT)"
])
AS_IF([test -n "$_DUNE_MODULE[]_VERSION"],[
result="$result version $_DUNE_MODULE[]_VERSION"
result="$result version $_DUNE_MODULE[]_VERSION"
])
DUNE_ADD_SUMMARY_MOD_ENTRY(_dune_name,[$result])
])
......@@ -131,10 +131,16 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
AS_IF([test -d "$_DUNE_MODULE[]_ROOT/include/dune"],[
# Dune was installed into directory given by with-dunecommon
_DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_ROOT/include"
_DUNE_MODULE[]_VERSION="`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$_DUNE_MODULE[]_ROOT/lib/pkgconfig $PKG_CONFIG --modversion _dune_name`" 2>/dev/null
_DUNE_MODULE[]_BUILDDIR=_DUNE_MODULE[]_ROOT
_DUNE_MODULE[]_VERSION="`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$_DUNE_MODULE[]_ROOT/lib/pkgconfig $PKG_CONFIG --modversion _dune_name`" 2>/dev/null
],[
_DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_ROOT"
_DUNE_MODULE[]_VERSION="`grep Version $_DUNE_MODULE[]_ROOT/dune.module | sed -e 's/^Version: *//'`" 2>/dev/null
_DUNE_MODULE[]_SRCDIR=$_DUNE_MODULE[]_ROOT
# extract src and build path from Makefile, if found
AS_IF([test -f $_DUNE_MODULE[]_ROOT/Makefile],[
_DUNE_MODULE[]_SRCDIR="`grep '^abs_top_srcdir = ' $_DUNE_MODULE[]_ROOT/Makefile | sed -e 's/^abs_top_srcdir = //'`"
])
_DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_SRCDIR"
_DUNE_MODULE[]_VERSION="`grep Version $_DUNE_MODULE[]_SRCDIR/dune.module | sed -e 's/^Version: *//'`" 2>/dev/null
])
ifelse(_dune_symbol,,,[
_DUNE_MODULE[]_LDFLAGS="-L$_DUNE_MODULE[]_ROOT/lib"
......@@ -298,7 +304,7 @@ AC_DEFUN([DUNE_SYMLINK],[
])
],[
# if we are in the source directory we can make sure that there is no directory
AC_MSG_ERROR([Module is using the DUNE[]_SYMLINK directive but contains a directory 'dune'!])
AC_MSG_ERROR([Module is using the DUNE[]_SYMLINK directive but contains a directory 'dune'!])
])
],[
echo Creating dune-symlink...
......@@ -337,10 +343,10 @@ AC_DEFUN([DUNE_WEB],
],[
AC_MSG_ERROR([Dune-Web directory $with_duneweb not found!])
])
with_duneweb=no
with_duneweb=no
])
])
DUNE_ADD_SUMMARY_ENTRY([dune web],[$with_duneweb])
DUNE_ADD_SUMMARY_ENTRY([dune web],[$with_duneweb])
],[
with_duneweb=no
])
......
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