Add option to enable SVN revision display, defaulting to off.

This commit is contained in:
Eric S. Raymond 2007-04-25 15:39:59 +00:00
parent 9904309436
commit 0db20f348c
4 changed files with 18 additions and 4 deletions

View File

@ -55,6 +55,11 @@ you have a Subversion client installed but it is not implementing the
If you want to build wesnoth_editor too add the --enable-editor
configure option.
The --display-revision option enables code that shows the SVN revision
number on the main screen -- useful for detecting old builds you might
happen to have in your path, but probably not what you want in a
production release.
In case you want wesnothd to be built you should add:
--enable-server --localstatedir=/var --with-server-uid=user
--with-server-gid=group

View File

@ -237,6 +237,11 @@ AC_ARG_ENABLE([internal-data],
[internaldata=$enableval],
[internaldata=no])
AC_ARG_ENABLE([display-revision],
AS_HELP_STRING([--display-revisiion], [enable svn revision display]),
[svnrev=$enableval],
[svnrev=no])
AM_CONDITIONAL([STATIC], [test x$static = xyes])
AM_CONDITIONAL([GAME], [test x$game = xyes])
AM_CONDITIONAL([SERVER], [test x$server = xyes])
@ -256,6 +261,10 @@ if test x$internaldata = xyes; then
AC_DEFINE([USE_INTERNAL_DATA],[],[Define if translations should be placed inside app, for Mac OS X])
fi
if test x$svnrev = xyes; then
AC_DEFINE([DO_DISPLAY_REVISION],[],[Define if SVN revision should be displayed when querying the version])
fi
AC_ARG_ENABLE([desktop-entry],
AS_HELP_STRING([--disable-desktop-entry], [disable installation of desktop entry files]),
[desktopentry=$enableval],

View File

@ -67,9 +67,9 @@ int main(int argc, char** argv)
} else if(val == "--version" || val == "-v") {
std::cout << "Battle for Wesnoth "
<< game_config::version
#ifdef SVNREV
#if defined(SVNREV) and defined(DO_DISPLAY_REVISION)
<< " (" << game_config::svnrev << ")"
#endif /* SVNREV */
#endif /* defined(SVNREV) and defined(DO_DISPLAY_REVISION) */
<< "\n";
return 0;
} else if(val == "--path") {

View File

@ -232,9 +232,9 @@ TITLE_RESULT show_title(display& screen, config& tips_of_day, int* ntip)
const std::string& version_str = _("Version") + std::string(" ") +
game_config::version
#ifdef SVNREV
#if defined(SVNREV) and defined(DO_DISPLAY_REVISION)
+ " (" + game_config::svnrev + ")"
#endif /* SVNREV */
#endif /* defined(SVNREV) and defined(DO_DISPLAY_REVISION) */
;
const SDL_Rect version_area = font::draw_text(NULL,screen_area(),