aboutsummaryrefslogtreecommitdiffstats
path: root/build_tools/prep_moduledeps
blob: 21f1f5e4a9c203d1f149972fe30b8b1a71ee8c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

get_description() {
	TDESC=`grep -e AST_MODULE_INFO ${1} | head -n 1 | cut -d '"' -f 2`
}

process_dir() {
	dir=${1}
	prefix=${2}_
	catsuffix=${3}
	displayname=${4}

	echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\" remove_on_change=\"${dir}/modules.link\">"
	for file in `ls ${dir}/${prefix}*.c ${dir}/${prefix}*.cc 2> /dev/null | sort`
	do
		if [ ! -f ${file} ]; then
			continue
		fi
		fname=`basename ${file} .c`
		fname=`basename ${fname} .cc`
		get_description ${file}
		desc=${TDESC}
		echo -e "\t\t<member name=\"${fname}\" displayname=\"${desc}\" remove_on_change=\"${dir}/${fname}.o ${dir}/${fname}.oo ${dir}/${fname}.so\">"
		awk -f build_tools/get_moduleinfo ${file}
		echo -e "\t\t</member>"
		awk -f build_tools/get_makeopts ${file} >> .makeoptstmp
	done
	echo -e "\t</category>"
}

echo "<?xml version=\"1.0\"?>"
echo
echo "<menu name=\"Asterisk Module Selection\">"
rm -f .makeoptstmp
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"
process_dir funcs func FUNCS "Dialplan Functions"
process_dir pbx pbx PBX "PBX Modules"
process_dir res res RES "Resource Modules"
cat .makeoptstmp
cat build_tools/cflags.xml
cat build_tools/embed_modules.xml
cat sounds/sounds.xml
rm -f .makeoptstmp
echo "</menu>"