2006-04-24 17:11:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-05-09 08:45:37 +00:00
|
|
|
get_description() {
|
|
|
|
x=${1}
|
|
|
|
TDESC=`cat $x | grep -e *tdesc | cut -f 2 -d '"'`
|
|
|
|
if [ "$TDESC" = "" ]; then
|
|
|
|
TDESC=`cat $x | grep -A 2 -e *description | grep -e '\"' | cut -f 2 -d '"'`
|
|
|
|
fi
|
|
|
|
if [ "$TDESC" = "" ]; then
|
|
|
|
TDESC=`cat $x | grep -e MODULE_DESCRIPTION | grep -v return | cut -f 2 -d '"'`
|
|
|
|
fi
|
|
|
|
if [ "$TDESC" = "" ]; then
|
|
|
|
TDESC=`cat $x | grep -e tdesc\\\[\\\] | cut -f 2 -d '"'`
|
|
|
|
fi
|
|
|
|
if [ "$TDESC" = "" ]; then
|
|
|
|
TDESC=`cat $x | grep -e desc\\\[\\\] | grep -v description | cut -f 2 -d '"'`
|
|
|
|
fi
|
|
|
|
if [ "$TDESC" = "" ]; then
|
|
|
|
TDESC=`cat $x | grep -e *desc | grep -v descrip | cut -f 2 -d '"'`
|
|
|
|
fi
|
|
|
|
if [ "$TDESC" = "" ]; then
|
|
|
|
TDESC=`cat $x | grep -e *dtext | grep static | cut -f 2 -d '"'`
|
|
|
|
fi
|
|
|
|
if [ "$TDESC" = "" ]; then
|
|
|
|
TDESC=`cat $x | grep -A 2 -e *synopsis | grep -e '\"' | cut -f 2 -d '"'`
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2006-04-24 17:11:45 +00:00
|
|
|
process_dir() {
|
|
|
|
dir=${1}
|
|
|
|
prefix=${2}_
|
|
|
|
catsuffix=${3}
|
|
|
|
displayname=${4}
|
|
|
|
|
|
|
|
echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\">"
|
2006-07-07 02:33:24 +00:00
|
|
|
for file in `ls ${dir}/${prefix}*.c ${dir}/${prefix}*.cc 2> /dev/null | sort`
|
2006-04-24 17:11:45 +00:00
|
|
|
do
|
2006-07-07 02:58:53 +00:00
|
|
|
if [ ! -f ${file} ]; then
|
2006-07-07 02:33:24 +00:00
|
|
|
continue
|
|
|
|
fi
|
2006-06-30 04:33:18 +00:00
|
|
|
fname=`basename ${file} .c`
|
2006-07-06 23:51:15 +00:00
|
|
|
fname=`basename ${fname} .cc`
|
2006-05-09 08:45:37 +00:00
|
|
|
get_description ${file}
|
|
|
|
desc=${TDESC}
|
2006-07-06 23:51:15 +00:00
|
|
|
echo -e "\t\t<member name=\"${fname}\" displayname=\"${desc}\" remove_on_change=\"${dir}/${fname}.o ${dir}/${fname}.oo ${dir}/${fname}.so\">"
|
2006-06-16 16:17:43 +00:00
|
|
|
awk -f build_tools/get_moduleinfo ${file}
|
2006-04-24 17:11:45 +00:00
|
|
|
echo -e "\t\t</member>"
|
|
|
|
done
|
|
|
|
echo -e "\t</category>"
|
2006-06-16 16:17:43 +00:00
|
|
|
|
|
|
|
for file in ${dir}/${prefix}*.c
|
|
|
|
do
|
|
|
|
awk -f build_tools/get_makeopts ${file} >> .makeoptstmp
|
|
|
|
done
|
2006-04-24 17:11:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
echo "<?xml version="1.0"?>"
|
|
|
|
echo
|
2006-06-24 04:10:41 +00:00
|
|
|
echo "<menu name=\"Asterisk Module Selection\">"
|
2006-06-16 16:17:43 +00:00
|
|
|
rm -f .makeoptstmp
|
2006-04-24 17:11:45 +00:00
|
|
|
process_dir apps app APPS Applications
|
|
|
|
process_dir cdr cdr CDR "Call Detail Recording"
|
|
|
|
process_dir channels chan CHANNELS "Channel Drivers"
|
|
|
|
process_dir codecs codec CODECS "Codec Translators"
|
|
|
|
process_dir formats format FORMATS "Format Interpreters"
|
2006-04-28 17:17:46 +00:00
|
|
|
process_dir funcs func FUNCS "Dialplan Functions"
|
2006-04-24 17:11:45 +00:00
|
|
|
process_dir pbx pbx PBX "PBX Modules"
|
|
|
|
process_dir res res RES "Resource Modules"
|
|
|
|
cat build_tools/cflags.xml
|
2006-06-07 20:54:30 +00:00
|
|
|
cat sounds/sounds.xml
|
2006-06-16 16:17:43 +00:00
|
|
|
cat .makeoptstmp
|
|
|
|
rm -f .makeoptstmp
|
2006-04-24 17:11:45 +00:00
|
|
|
echo "</menu>"
|