From 5109a30910f4072449ac71aa12a43f69debc3135 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 27 Jan 2006 17:59:06 +0000 Subject: [PATCH] (vers): Don't report KSU distribution (1.04 in all known versions), Chainsaw version (4.00 since Empire 2, ca. 1995) and Wolfpack version (used to be the version number after the first dot). (KSU_DIST, CHAINSAW_DIST, WOLFPACK_DIST): Unused, remove. (version): New. (EMP_VERS_MAJOR, EMP_VERS_MINOR, EMP_VERS_PATCH): Remove. Users changed to use version[] instead. version[] is slightly easier to initialize from configure.ac. (check-version): No longer needed, remove. (legal): New. (vers, main): Show it. --- Make.mk | 7 +------ include/version.h | 12 ++++-------- src/lib/commands/vers.c | 7 ++++--- src/lib/global/version.c | 41 ++++++++++++++++++++++++++++++++++++++++ src/server/main.c | 3 +-- 5 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 src/lib/global/version.c diff --git a/Make.mk b/Make.mk index f62a493c..ac2cdb58 100644 --- a/Make.mk +++ b/Make.mk @@ -293,7 +293,7 @@ endif # .PHONY: dist-source -dist-source: check-version $(src_distgen) $(bld_distgen) +dist-source: $(src_distgen) $(bld_distgen) $(tarball) $(TARNAME)-$(VERSION) $(bld_distgen) -C $(srcdir) $(src_distgen) $(src) .PHONY: dist-client @@ -310,11 +310,6 @@ dist-info: info html $(tarball) $(TARNAME)-info-text-$(VERSION) -C info.nr $(info) $(tarball) $(TARNAME)-info-html-$(VERSION) -C info.html $(addsuffix .html, $(info)) -check-version: - if [ $(VERSION) != `sed -n '/EMP_VERS_/s/#define EMP_VERS_\([A-Z]*\)[ \t]*//p' <$(srcdir)/include/version.h | tr '\012' . | sed 's/\.$$//'` ]; \ - then echo version.h does not match configure.ac >&2; false; \ - fi - ifneq ($(deps),) -include $(deps) endif diff --git a/include/version.h b/include/version.h index da9c14d7..7edf7057 100644 --- a/include/version.h +++ b/include/version.h @@ -25,23 +25,19 @@ * * --- * - * version.h: describes major, minor and release levels of the software + * version.h: Version information * * Known contributors to this file: * Thomas Ruschak, 1992 * Ken Stevens, 1995 * Steve McClure, 1998, 1999 + * Markus Armbruster, 2006 */ #ifndef VERSION_H #define VERSION_H -#define EMP_VERS_MAJOR 4 -#define EMP_VERS_MINOR 3 -#define EMP_VERS_PATCH 0 - -#define KSU_DIST 1.04 -#define CHAINSAW_DIST 4.00 -#define WOLFPACK_DIST 3.00 +extern char version[]; +extern char legal[]; #endif diff --git a/src/lib/commands/vers.c b/src/lib/commands/vers.c index afcfaefa..6c4742d4 100644 --- a/src/lib/commands/vers.c +++ b/src/lib/commands/vers.c @@ -55,7 +55,7 @@ vers(void) time_t now; (void)time(&now); - pr("Empire %d.%d.%d\n(KSU distribution %2.2f, Chainsaw version %2.2f, Wolfpack version %2.2f)\n\n", EMP_VERS_MAJOR, EMP_VERS_MINOR, EMP_VERS_PATCH, (float)KSU_DIST, (float)CHAINSAW_DIST, (float)WOLFPACK_DIST); + pr("%s\n\n", version); pr("The following parameters have been set for this game:\n"); pr("World size is %d by %d.\n", WORLD_X, WORLD_Y); pr("There can be up to %d countries.\n", MAXNOC); @@ -166,10 +166,11 @@ vers(void) show_opts(0); pr("\n\nSee \"info Options\" for a detailed list of options and descriptions."); pr("\n\n"); - pr("The person to annoy if something goes wrong is:\n\t%s\n\t(%s).\n", + pr("The person to annoy if something goes wrong is:\n\t%s\n\t(%s).\n\n", privname, privlog); pr("You can get your own copy of the source from " - "http://www.wolfpackempire.com/\n"); + "http://www.wolfpackempire.com/\n\n"); + pr("%s", legal); return RET_OK; } diff --git a/src/lib/global/version.c b/src/lib/global/version.c new file mode 100644 index 00000000..de91ed32 --- /dev/null +++ b/src/lib/global/version.c @@ -0,0 +1,41 @@ +/* + * Empire - A multi-player, client/server Internet based war game. + * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak, + * Ken Stevens, Steve McClure + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * --- + * + * See files README, COPYING and CREDITS in the root of the source + * tree for related information and legal notices. It is expected + * that future projects/authors will amend these files as needed. + * + * --- + * + * version.c: + * + * Known contributors to this file: + * Markus Armbruster, 2006 + */ + +#include + +char version[] = PACKAGE_STRING; +char legal[] = +"Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,\n" +" Ken Stevens, Steve McClure\n" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"; diff --git a/src/server/main.c b/src/server/main.c index 841b5904..43bd8ec2 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -159,8 +159,7 @@ main(int argc, char **argv) flags |= EMPTH_STACKCHECK; break; case 'v': - printf("Wolfpack Empire %d.%d.%d\n", - EMP_VERS_MAJOR, EMP_VERS_MINOR, EMP_VERS_PATCH); + printf("%s\n\n%s", version, legal); return EXIT_SUCCESS; case 'h': print_usage(argv[0]);