mirror of https://github.com/asterisk/asterisk
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: https://origsvn.digium.com/svn/asterisk/trunk@96717 65c4cc65-6c06-0410-ace0-fbb531ad65f31.6.0
parent
3e28c57081
commit
54bc2c20b6
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
if [ ! -f ../.flavor ]; then
|
||||
EXTRA=""
|
||||
else
|
||||
aadkver=`cat ../.version`
|
||||
aadkflavor=`cat ../.flavor`
|
||||
EXTRA=" (${aadkflavor} ${aadkver})"
|
||||
fi
|
||||
cat << END
|
||||
/*
|
||||
* version.c
|
||||
* Automatically generated
|
||||
*/
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
#include "asterisk/version.h"
|
||||
|
||||
static const char asterisk_version[] = "${ASTERISKVERSION}${EXTRA}";
|
||||
|
||||
static const char asterisk_version_num[] = "${ASTERISKVERSIONNUM}";
|
||||
|
||||
const char *ast_get_version(void)
|
||||
{
|
||||
return asterisk_version;
|
||||
}
|
||||
|
||||
const char *ast_get_version_num(void)
|
||||
{
|
||||
return asterisk_version_num;
|
||||
}
|
||||
|
||||
END
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
if [ ! -f ../.flavor ]; then
|
||||
EXTRA=""
|
||||
else
|
||||
aadkver=`cat ../.version`
|
||||
aadkflavor=`cat ../.flavor`
|
||||
EXTRA=" (${aadkflavor} ${aadkver})"
|
||||
fi
|
||||
cat << END
|
||||
/*
|
||||
* version.h
|
||||
* Automatically generated
|
||||
*/
|
||||
#define ASTERISK_VERSION "${ASTERISKVERSION}${EXTRA}"
|
||||
#define ASTERISK_VERSION_NUM ${ASTERISKVERSIONNUM}
|
||||
|
||||
END
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Russell Bryant <russell@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \file
|
||||
* \brief Asterisk version information
|
||||
* \author Russell Bryant <russell@digium.com>
|
||||
*/
|
||||
|
||||
#ifndef __AST_VERSION_H
|
||||
#define __AST_VERSION_H
|
||||
|
||||
/*!
|
||||
* \brief Retrieve the Asterisk version string.
|
||||
*/
|
||||
const char *ast_get_version(void);
|
||||
|
||||
/*!
|
||||
* \brief Retrieve the numeric Asterisk version
|
||||
*
|
||||
* Format ABBCC
|
||||
* AABB - Major version (1.4 would be 104)
|
||||
* CC - Minor version
|
||||
*
|
||||
* 1.4.17 would be 10417.
|
||||
*/
|
||||
const char *ast_get_version_num(void);
|
||||
|
||||
#endif /* __AST_VERSION_H */
|
Loading…
Reference in new issue