Store build-time options as a string in AST_BUILDOPTS in buildopts.h. Also,
authorRussell Bryant <russell@russellbryant.com>
Thu, 22 May 2008 13:40:52 +0000 (13:40 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 22 May 2008 13:40:52 +0000 (13:40 +0000)
display this information in the "core show settings" CLI command.  This is
useful if you want to verify that you're running a build with DONT_OPTIMIZE,
DEBUG_THREADS, etc.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117756 65c4cc65-6c06-0410-ace0-fbb531ad65f3

build_tools/make_buildopts_h
main/asterisk.c

index 00b3eed..f721dbc 100755 (executable)
@@ -10,6 +10,11 @@ END
 TMP=`${GREP} -e ^MENUSELECT_CFLAGS menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
 for x in ${TMP}; do
        echo "#define ${x} 1"
+       if test "x${BUILDOPTS}" != "x" ; then
+               BUILDOPTS="${BUILDOPTS}, ${x}"
+       else
+               BUILDOPTS="${x}"
+       fi
 done
 TMP=`${GREP} -e ^MENUSELECT_BUILD_DEPS menuselect.makeopts | sed 's/MENUSELECT_BUILD_DEPS\=//g'`
 for x in ${TMP}; do
@@ -35,3 +40,5 @@ SunOS)
 esac
 
 echo "#define AST_BUILDOPT_SUM \"${BUILDSUM}\""
+
+echo "#define AST_BUILDOPTS \"${BUILDOPTS}\""
index 4b67c04..d28e556 100644 (file)
@@ -398,6 +398,7 @@ static char *handle_show_settings(struct ast_cli_entry *e, int cmd, struct ast_c
        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)"));
        if (option_maxcalls)
                ast_cli(a->fd, "  Maximum calls:               %d (Current %d)\n", option_maxcalls, ast_active_channels());
        else