~ctwm/ctwm/trunk

304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
1
/*
554.1.6 by Matthew Fuller
Collapse away redundant license texts in most .h files. These are all
2
 *       Copyright 1988 by Evans & Sutherland Computer Corporation,
3
 *                          Salt Lake City, Utah
4
 *  Portions Copyright 1989 by the Massachusetts Institute of Technology
5
 *                        Cambridge, Massachusetts
6
 *
7
 * Copyright 1992 Claude Lecommandeur.
11 by Claude Lecommandeur
CTWM version 3.2p1
8
 */
1 by Claude Lecommandeur
CTWM version 1.1
9
338.1.2 by Matthew Fuller
Make sure ctwm.h is pulled into all our C files.
10
#include "ctwm.h"
322.1.23 by Matthew Fuller
Include version header to sneak away from warnings about the vars.
11
#include "version.h"
438.2.1 by Matthew Fuller
Split up version info so we can differentiate specific bits of the
12
466.1.7 by Matthew Fuller
Define the version bits in the cmake config rather than in the C file,
13
#define VERSION_MAJOR "@ctwm_version_major@"
14
#define VERSION_MINOR "@ctwm_version_minor@"
15
#define VERSION_PATCH "@ctwm_version_patch@"
16
#define VERSION_ADDL  "@ctwm_version_addl@"
438.2.1 by Matthew Fuller
Split up version info so we can differentiate specific bits of the
17
18
#define VERSION_ID VERSION_MAJOR "." VERSION_MINOR "." VERSION_PATCH
19
#define VERSION_ID_FULL VERSION_ID VERSION_ADDL
20
21
const char *TwmVersion = "MIT X Consortium, R6, ctwm " VERSION_ID_FULL;
323.1.8 by Matthew Fuller
These are definitely consty.
22
const char *VersionNumber = VERSION_ID;
438.2.1 by Matthew Fuller
Split up version info so we can differentiate specific bits of the
23
const char *VersionNumberFull = VERSION_ID_FULL;
438.1.4 by Matthew Fuller
Add split out major/minor/patch/addl defines into the m4 output.
24
const char *VersionNumber_major = VERSION_MAJOR;
25
const char *VersionNumber_minor = VERSION_MINOR;
26
const char *VersionNumber_patch = VERSION_PATCH;
27
const char *VersionNumber_addl  = VERSION_ADDL;
475.1.1 by Matthew Fuller
Add an extra var for VCSType and populate it appropriately.
28
const char *VCSType     = %%VCSTYPE%%;
411.1.1 by Matthew Fuller
Move to always processing version.c, and inagurate by just turning the
29
const char *VCSRevision = %%REVISION%%;
466.1.3 by Matthew Fuller
Adjust version.c so it can be built standalone for printing out bits
30
31
#ifdef BUILD_VERSION_BIN
32
#include <stdio.h>
33
#include <unistd.h>
34
35
int
36
main(int argc, char *argv[])
37
{
38
	int ch;
39
40
	if((ch = getopt(argc, argv, "Mmpa")) != -1) {
41
		switch(ch) {
42
			case 'M':
43
				printf("%s\n", VersionNumber_major);
44
				exit(0);
45
			case 'm':
46
				printf("%s\n", VersionNumber_minor);
47
				exit(0);
48
			case 'p':
49
				printf("%s\n", VersionNumber_patch);
50
				exit(0);
51
			case 'a':
52
				printf("%s\n", VersionNumber_addl);
53
				exit(0);
54
			default:
55
				printf("Dunno.\n");
56
				exit(1);
57
		}
58
	}
59
60
	printf("%s\n", VersionNumberFull);
61
	exit(0);
62
}
63
#endif /* BUILD_VERSION_BIN */