closes issue #11287; thanks to snuffy for this fix, which will surely make all solari...
[asterisk/asterisk.git] / build_tools / make_buildopts_h
1 #!/bin/sh
2
3 cat << END
4 /*
5  * buildopts.h 
6  * Automatically generated
7  */
8
9 END
10 TMP=`${GREP} MENUSELECT_CFLAGS menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
11 for x in ${TMP}; do
12         echo "#define ${x} 1"
13 done
14 TMP=`${GREP} MENUSELECT_BUILD_DEPS menuselect.makeopts | sed 's/MENUSELECT_BUILD_DEPS\=//g'`
15 for x in ${TMP}; do
16         x2=`echo ${x} | tr a-z A-Z`
17         echo "#define AST_MODULE_${x2} 1"
18 done
19 if ${GREP} AST_DEVMODE makeopts | ${GREP} -q yes
20 then
21         echo "#define AST_DEVMODE 1"
22         TMP="${TMP} AST_DEVMODE"
23 fi
24
25 case ${OSARCH} in       # actually we should check build_os
26 *BSD|mingw|darwin*)
27         BUILDSUM=`echo ${TMP} | md5 | cut -c1-32`
28         ;;
29 SunOS)
30         BUILDSUM=`echo ${TMP} | digest -a md5 | cut -c1-32`
31         ;;
32 *)
33         BUILDSUM=`echo ${TMP} | md5sum | cut -c1-32`
34         ;;
35 esac
36
37 echo "#define AST_BUILDOPT_SUM \"${BUILDSUM}\""