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

add m4suggests

[[Imported from SVN: r5155]]
parent 37a070c8
Branches
Tags
No related merge requests found
......@@ -493,10 +493,15 @@ case "$command" in
if test "x$SEARCH_MODULES" != "x"; then
MODULES=$SEARCH_MODULES
fi
if test "x$ONLY" != x; then
MODULES=$ONLY
sort_dependencies $MODULES
eval "print_module_list ',' $MODULES"
;;
m4suggests)
find_modules_in_path
if test "x$SEARCH_MODULES" != "x"; then
MODULES=$SEARCH_MODULES
fi
sort_dependecies $MODULES
sort_suggestions $MODULES
eval "print_module_list ',' $MODULES"
;;
export)
......
......@@ -148,7 +148,7 @@ sort_modules() {
# sort $MODULES's dependencies according to the dependencies
# don't include $MODULE itself
#
sort_dependecies() {
sort_dependencies() {
# reset list
export SORTEDMODULES=""
# handle each modules passed as parameter
......@@ -174,6 +174,53 @@ sort_dependecies() {
done
}
#
# sort $MODULES's dependencies according to the dependencies
# don't include $MODULE itself
#
sort_suggestions() {
# get dependencies
sort_dependencies $@
export DEPENDENCIES="$SORTEDMODULES"
# 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 \$SUGS_$m)" != "x" ; then
for name in $(eval echo \$SUGS_$m); do
dep=$(fix_variable_name $name)
if test "x$(eval echo \$HAVE_$dep)" != "x"; then
_sort_module $dep
fi
done
fi
else
echo "ERROR: could not find module $(eval echo \$NAME_$m)" > /dev/stderr
exit 1
fi
done
# save result
local FOUND=no
export MODULES=""
for m in $SORTEDMODULES; do
FOUND=no
for d in $DEPENDENCIES; do
if test "x$m" = "x$d"; then
FOUND=yes
fi
done
if test "x$FOUND" = "xno"; then
export MODULES="$MODULES $m"
fi
done
# 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.
Please register or to comment