diff options
| author | sjaz <sjaz@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-01 12:00:20 +0000 |
|---|---|---|
| committer | sjaz <sjaz@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-01 12:00:20 +0000 |
| commit | c777c8d9aa7cd5c2e9a399727a7fa9985a77fb1c (patch) | |
| tree | 9e996ae4a1bbb833cec036c5cd4d87a590149e85 /include/version.sh | |
Anope Stable Branch
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1902 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include/version.sh')
| -rw-r--r-- | include/version.sh | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/include/version.sh b/include/version.sh new file mode 100644 index 000000000..1ee2d756c --- /dev/null +++ b/include/version.sh @@ -0,0 +1,86 @@ +#!/bin/sh +# +# Build version string and increment Services build number. +# + +# Grab version information from the version control file. +CTRL="../version.log" +if [ -f $CTRL ] ; then + . $CTRL +else + echo "Error: Unable to find control file: $CTRL" + exit 0 +fi + +VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA} (${VERSION_BUILD})" +VERSIONDOTTED="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA}.${VERSION_BUILD}" + +if [ -f version.h ] ; then + BUILD=`fgrep '#define BUILD' version.h | sed 's/^#define BUILD.*\([0-9]*\).*$/\1/'` + BUILD=`expr $BUILD + 1 2>/dev/null` +else + BUILD=1 +fi +if [ ! "$BUILD" ] ; then + BUILD=1 +fi +cat >version.h <<EOF +/* Version information for Services. + * + * (C) 2003-2008 Anope Team + * Contact us at info@anope.org + * + * Please read COPYING and CREDITS for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * This file is auto-generated by version.sh + * + */ + + #ifndef VERSION_H + #define VERSION_H + +#define VERSION_MAJOR $VERSION_MAJOR +#define VERSION_MINOR $VERSION_MINOR +#define VERSION_PATCH $VERSION_PATCH +#define VERSION_EXTRA "$VERSION_EXTRA" +#define VERSION_BUILD $VERSION_BUILD + +#define BUILD "$BUILD" +#define VERSION_STRING "$VERSION" +#define VERSION_STRING_DOTTED "$VERSIONDOTTED" + +#ifdef DEBUG_COMMANDS +# define VER_DEBUG "D" +#else +# define VER_DEBUG +#endif + +#if defined(_WIN32) +# if _MSC_VER >= 1400 +# define VER_OS "W" +# else +# define VER_OS "w" +# endif +#else +# define VER_OS +#endif + +#if defined(USE_MYSQL) +# define VER_MYSQL "Q" +#else +# define VER_MYSQL +#endif + +#if defined(USE_MODULES) +# define VER_MODULE "M" +#else +# define VER_MODULE +#endif + +#endif + +EOF + |
