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

* automatically generate dependency list from dune.module file

* new function DUNE_AC_INIT which should be used instead of AC_INIT

[[Imported from SVN: r5051]]
parent 7a02459c
No related branches found
No related tags found
No related merge requests found
......@@ -221,6 +221,8 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
])
AC_DEFUN([DUNE_CHECK_DISPATCH],[
m4_syscmd(test -n "$1" \
&& echo " dune.m4: adding dependency check for $1" > /dev/stderr)
ifelse([$1], [], [],
[$1], [dune-common],[
#DUNE_CHECK_MODULES(module_name, test_header, test_symbol)
......@@ -242,10 +244,14 @@ AC_DEFUN([DUNE_CHECK_DISPATCH],[
[AC_MSG_ERROR([Unknown module $1])])
])
AC_DEFUN([DUNE_MODULE_DEPENDENCIES],[
ifelse($#, 0, , $#, 1, [DUNE_CHECK_DISPATCH($1)], [DUNE_CHECK_DISPATCH($1) DUNE_MODULE_DEPENDENCIES(m4_shift($@))])
AC_DEFUN([_DUNE_MODULE_DEPENDENCIES],[
ifelse($#, 0, , $#, 1, [DUNE_CHECK_DISPATCH($1)], [DUNE_CHECK_DISPATCH($1) _DUNE_MODULE_DEPENDENCIES(m4_shift($@))])
])
AC_DEFUN([DUNE_MODULE_DEPENDENCIES],[
m4_syscmd(echo " dune.m4: getting dependencies for $@" > /dev/stderr)
_DUNE_MODULE_DEPENDENCIES(m4_esyscmd(dunecontrol --only=$@ m4depends))])
AC_DEFUN([DUNE_DEV_MODE],[
AC_ARG_ENABLE(dunedevel,
AC_HELP_STRING([--enable-dunedevel],[activate Dune-Developer-mode]))
......
......@@ -16,6 +16,24 @@
# In addition to DUNE_CHECK_ALL it run some additional tests
# and sets up some things needed for modules (i.e. the 'dune' symlink)
m4_define([DUNE_PARSE_MODULE_FILE],[
m4_define([DUNE_MOD_VERSION],
[m4_esyscmd([grep ^Version: dune.module | tr '\n' ' ' | sed -e 's/^.*://' -e 's/\s*//'])])
m4_define([DUNE_MOD_NAME],
[m4_esyscmd([grep ^Module: dune.module | tr '\n' ' ' | sed -e 's/^.*://' -e 's/\s*//'])])
])
m4_define([DUNE_AC_INIT],[
PARSE_MODULE_FILE
AC_INIT(DUNE_MOD_NAME, DUNE_MOD_VERSION, dune@dune-project.org)
])
AC_DEFUN([DUNE_CHECK_DEPENDENCIES], [
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
DUNE_PARSE_MODULE_FILE
DUNE_MODULE_DEPENDENCIES(DUNE_MOD_NAME)
])
AC_DEFUN([DUNE_CHECK_ALL],[
AC_LANG_PUSH([C++])
dnl check for programs
......@@ -91,7 +109,8 @@ fi
AC_SUBST(DUNEWEBDIR, $with_duneweb)
dnl check all components
DUNE_MODULE_DEPENDENCIES($@)
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_REQUIRE([DUNE_CHECK_DEPENDENCIES])
AC_REQUIRE([DUNE_SET_MINIMAL_DEBUG_LEVEL])
AC_REQUIRE([DUNE_PATH_XDR])
AC_REQUIRE([DUNE_GRID_DIMENSION])
......@@ -192,7 +211,6 @@ AC_DEFUN([DUNE_CHECK_ALL_M],[
if test "x$with_revision" = "xno" ; then with_revision=bar; fi
AC_SUBST(revision, $with_revision)
DUNE_MODULE_DEPENDENCIES($@)
AC_REQUIRE([DUNE_CHECK_ALL])
AC_REQUIRE([DUNE_DEV_MODE])
AC_REQUIRE([DUNE_PKG_CONFIG_REQUIRES])
......
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