various menuselect fixes as a result of boredom during a 9 hour flight and
[asterisk/asterisk.git] / build_tools / prep_moduledeps
1 #!/bin/sh
2
3 process_dir() {
4         dir=${1}
5         prefix=${2}_
6         catsuffix=${3}
7         displayname=${4}
8
9         echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\">"
10         for file in ${dir}/${prefix}*.c
11         do
12                 fname=${file##${dir}/}
13                 echo -e "\t\t<member name=\"${fname%%.c}.so\">"
14                 awk -f build_tools/get_moduledeps ${file}
15                 echo -e "\t\t</member>"
16         done
17         echo -e "\t</category>"
18 }
19
20 echo "<?xml version="1.0"?>"
21 echo
22 echo "<menu>"
23 process_dir apps app APPS Applications
24 process_dir cdr cdr CDR "Call Detail Recording"
25 process_dir channels chan CHANNELS "Channel Drivers"
26 process_dir codecs codec CODECS "Codec Translators"
27 process_dir formats format FORMATS "Format Interpreters"
28 process_dir funcs func FUNCS "Dialplan Functions"
29 process_dir pbx pbx PBX "PBX Modules"
30 process_dir res res RES "Resource Modules"
31 cat build_tools/cflags.xml
32 echo "</menu>"