1#!/bin/sh
2
3#
4# Find all config files (config*.m4) and map them into lines with the
5# form: NUM? '0' ' ' PATH
6#
7# For example:
8#
9#  50 ./modules/generators/config5.m4
10#  0 ./modules/aaa/config.m4
11#  10 ./example/config1.m4
12#
13# These lines are sorted, then the first field is removed. Thus, we
14# have a set of paths sorted on the config-number (if present). All
15# config files without a number are sorted before those with a number.
16#
17
18configfiles=`find . -name "config*.m4" | \
19	sed 's#\(.*/config\)\(.*\).m4#\20 \1\2.m4#' | \
20	sort | \
21	sed 's#.* ##'`
22
23for configfile in $configfiles; do
24    if [ -r $configfile ]; then
25        echo "sinclude($configfile)"
26    fi
27done
28