]> git.pond.sub.org Git - empserver/commitdiff
(vers): Don't report KSU distribution (1.04 in all known versions),
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 27 Jan 2006 17:59:06 +0000 (17:59 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 27 Jan 2006 17:59:06 +0000 (17:59 +0000)
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
include/version.h
src/lib/commands/vers.c
src/lib/global/version.c [new file with mode: 0644]
src/server/main.c

diff --git a/Make.mk b/Make.mk
index f62a493c6f7522897f1644a8cd4cc0f5decd0db6..ac2cdb588830493524893ca7094798b965bc3059 100644 (file)
--- 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
index da9c14d7439e53693b225ff274064afe34c474ae..7edf7057cac431700b030981b6699b183335783f 100644 (file)
  *
  *  ---
  *
- *  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
index afcfaefa1089cb206abafd29c29f64faae2fee88..6c4742d403e3f5c8ae21a41d60ac1e0fc98f471d 100644 (file)
@@ -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 (file)
index 0000000..de91ed3
--- /dev/null
@@ -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 <config.h>
+
+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";
index 841b5904bee7648fbd649f770f7282969cfb18c1..43bd8ec2b4e0d3272e0ce4ae816d4c52311a1447 100644 (file)
@@ -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]);