@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
-main/version.c: FORCE .lastclean
+main/version.c: FORCE menuselect.makeopts .lastclean
@build_tools/make_version_c > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
#!/bin/sh
+
+GREP=${GREP:-grep}
+
if test ! -f .flavor ; then
EXTRA=""
elif test ! -f .version ; then
aadkflavor=`cat .flavor`
EXTRA=" (${aadkflavor} ${aadkver})"
fi
+
+if ${GREP} "AST_DEVMODE" makeopts | ${GREP} -q "yes"
+then
+ BUILDOPTS="AST_DEVMODE"
+fi
+
+TMP=`${GREP} -e "^MENUSELECT_CFLAGS" menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
+for x in ${TMP}; do
+ if test "x${BUILDOPTS}" != "x" ; then
+ BUILDOPTS="${BUILDOPTS}, ${x}"
+ else
+ BUILDOPTS="${x}"
+ fi
+done
+
cat << END
/*
* version.c
static const char asterisk_version_num[] = "${ASTERISKVERSIONNUM}";
+static const char asterisk_build_opts[] = "${BUILDOPTS}";
+
const char *ast_get_version(void)
{
return asterisk_version;
return asterisk_version_num;
}
+const char *ast_get_build_opts(void)
+{
+ return asterisk_build_opts;
+}
+
END
*/
const char *ast_get_version_num(void);
+/*! Retreive the Asterisk build options */
+const char *ast_get_build_opts(void);
+
#endif /* __AST_VERSION_H */
ast_cli(a->fd, "\nPBX Core settings\n");
ast_cli(a->fd, "-----------------\n");
ast_cli(a->fd, " Version: %s\n", ast_get_version());
- ast_cli(a->fd, " Build Options: %s\n", S_OR(AST_BUILDOPTS, "(none)"));
+ ast_cli(a->fd, " Build Options: %s\n", S_OR(ast_get_build_opts(), "(none)"));
if (option_maxcalls)
ast_cli(a->fd, " Maximum calls: %d (Current %d)\n", option_maxcalls, ast_active_channels());
else