aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-05 22:09:06 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-05 22:09:06 +0000
commitab908a2a8ba667754deb0120a3f87f979a8d49e3 (patch)
tree243c62517db25a0b199483928c97afce6ce2a3d4 /main/asterisk.c
parent080a06a473ca38783c382fd5df05619033b245e0 (diff)
Now that the version.h file was getting properly regenerated every time the svn
revision changed, every module that used the version was getting rebuilt after every svn update. This severly annoyed me pretty quickly, so I have improved the situation. Now, instead of generating version.h, main/version.c is generated. version.c includes the version information, as well as a couple of API calls for modules to retrieve the version. So now, only version.c will get rebuilt, and the main asterisk binary relinked, which is must faster than rebuilding http.c, manager.c, asterisk.c, relinking the asterisk binary, chan_sip.c, func_version.c, res_agi ... The only minor change in behavior here is that the version information reported by chan_sip, for example, is the version of the Asterisk core, and not necessarily the Asterisk version that the chan_sip module came from. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@96717 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 5d995c9a7..e1b2f6acf 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -135,7 +135,7 @@ int daemon(int, int); /* defined in libresolv of all places */
/*! \brief Welcome message when starting a CLI interface */
#define WELCOME_MESSAGE \
- ast_verbose("Asterisk " ASTERISK_VERSION ", Copyright (C) 1999 - 2007 Digium, Inc. and others.\n" \
+ ast_verbose("Asterisk %s, Copyright (C) 1999 - 2007 Digium, Inc. and others.\n" \
"Created by Mark Spencer <markster@digium.com>\n" \
"Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.\n" \
"This is free software, with components licensed under the GNU General Public\n" \
@@ -143,7 +143,7 @@ int daemon(int, int); /* defined in libresolv of all places */
"certain conditions. Type 'core show license' for details.\n" \
"=========================================================================\n" \
"NOTE: This is a development version of Asterisk, and should not be used in\n" \
- "production installations.\n");
+ "production installations.\n", ast_get_version());
/*! \defgroup main_options Main Configuration Options
* \brief Main configuration options from asterisk.conf or OS command line on starting Asterisk.
@@ -394,7 +394,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", "" ASTERISK_VERSION "" );
+ ast_cli(a->fd, " Version: %s\n", ast_get_version());
if (option_maxcalls)
ast_cli(a->fd, " Max. calls: %d (Current %d)\n", option_maxcalls, ast_active_channels());
else
@@ -980,7 +980,7 @@ static void *netconsole(void *vconsole)
if (gethostname(hostname, sizeof(hostname)-1))
ast_copy_string(hostname, "<Unknown>", sizeof(hostname));
- snprintf(tmp, sizeof(tmp), "%s/%ld/%s\n", hostname, (long)ast_mainpid, ASTERISK_VERSION);
+ snprintf(tmp, sizeof(tmp), "%s/%ld/%s\n", hostname, (long)ast_mainpid, ast_get_version());
fdprint(con->fd, tmp);
for (;;) {
fds[0].fd = con->fd;
@@ -1515,7 +1515,7 @@ static char *handle_version(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
if (a->argc != 3)
return CLI_SHOWUSAGE;
ast_cli(a->fd, "Asterisk %s built by %s @ %s on a %s running %s on %s\n",
- ASTERISK_VERSION, ast_build_user, ast_build_hostname,
+ ast_get_version(), ast_build_user, ast_build_hostname,
ast_build_machine, ast_build_os, ast_build_date);
return CLI_SUCCESS;
}
@@ -2387,12 +2387,12 @@ static void ast_remotecontrol(char * data)
static int show_version(void)
{
- printf("Asterisk " ASTERISK_VERSION "\n");
+ printf("Asterisk %s\n", ast_get_version());
return 0;
}
static int show_cli_help(void) {
- printf("Asterisk " ASTERISK_VERSION ", Copyright (C) 1999 - 2007, Digium, Inc. and others.\n");
+ printf("Asterisk %s, Copyright (C) 1999 - 2007, Digium, Inc. and others.\n", ast_get_version());
printf("Usage: asterisk [OPTIONS]\n");
printf("Valid Options:\n");
printf(" -V Display version number and exit\n");