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

implemented command m4depends

[[Imported from SVN: r5050]]
parent b616fb68
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,7 @@ build_modules() {
set -e
cd "$path"
eval_control $runcommand $path/$CONTROL
); then echo "--- Failed to build $module ---"; exit 1; fi
); then eval echo "--- Failed to build \$NAME_${module} ---"; exit 1; fi
eval echo "--- \$NAME_${module} done ---"
done
}
......@@ -454,12 +454,16 @@ case "$command" in
eval "print_module_list ' ' $MODULES"
echo > /dev/stderr
;;
m4print)
create_module_list
m4depends)
find_modules_in_path
if test "x$SEARCH_MODULES" != "x"; then
MODULES=$SEARCH_MODULES
fi
if test "x$ONLY" != x; then
MODULES=$ONLY
fi
sort_dependecies $MODULES
eval "print_module_list ',' $MODULES"
echo -n "Dependencies are: " > /dev/stderr
eval "print_module_list ',' $MODULES" > /dev/stderr
echo "." > /dev/stderr
;;
export)
create_module_list
......
......@@ -144,6 +144,36 @@ sort_modules() {
done
}
#
# sort $MODULES's dependencies according to the dependencies
# don't include $MODULE itself
#
sort_dependecies() {
# reset list
export SORTEDMODULES=""
# handle each modules passed as parameter
for m in "$@"; do
# did we find a module file for this mopdule?
if test "x$(eval echo \$HAVE_$m)" != "x"; then
if test "x$(eval echo \$DEPS_$m)" != "x" ; then
for name in $(eval echo \$DEPS_$m); do
dep=$(fix_variable_name $name)
_sort_module $dep
done
fi
else
echo "ERROR: could not find module $(eval echo \$NAME_$m)" > /dev/stderr
exit 1
fi
done
# save result
export MODULES="$SORTEDMODULES"
# clean up temporary variables
for m in $MODULES; do
export SORT_DONE_${m}=""
done
}
#
# recursive part of sort_modules
# evaluate dependencies of one module
......
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