Switch to using automake for the Unix autoconfigured build.
[u/mdw/putty] / version.c
1 /*
2 * PuTTY version numbering
3 */
4
5 #define STR1(x) #x
6 #define STR(x) STR1(x)
7
8 #ifdef INCLUDE_EMPTY_H
9 /*
10 * Horrible hack to force version.o to be rebuilt unconditionally in
11 * the automake world: empty.h is an empty header file, created by the
12 * makefile and forcibly updated every time make is run. Including it
13 * here causes automake to track it as a dependency, which will cause
14 * version.o to be rebuilt too.
15 *
16 * The space between # and include causes mkfiles.pl's dependency
17 * scanner (for all other makefile types) to ignore this include,
18 * which is correct because only the automake makefile passes
19 * -DINCLUDE_EMPTY_H to enable it.
20 */
21 # include "empty.h"
22 #endif
23
24 #if defined SNAPSHOT
25
26 #if defined SVN_REV
27 #define SNAPSHOT_TEXT STR(SNAPSHOT) ":r" STR(SVN_REV)
28 #else
29 #define SNAPSHOT_TEXT STR(SNAPSHOT)
30 #endif
31
32 char ver[] = "Development snapshot " SNAPSHOT_TEXT;
33 char sshver[] = "PuTTY-Snapshot-" SNAPSHOT_TEXT;
34
35 #undef SNAPSHOT_TEXT
36
37 #elif defined RELEASE
38
39 char ver[] = "Release " STR(RELEASE);
40 char sshver[] = "PuTTY-Release-" STR(RELEASE);
41
42 #elif defined SVN_REV
43
44 char ver[] = "Custom build r" STR(SVN_REV) ", " __DATE__ " " __TIME__;
45 char sshver[] = "PuTTY-Custom-r" STR(SVN_REV);
46
47 #else
48
49 char ver[] = "Unidentified build, " __DATE__ " " __TIME__;
50 char sshver[] = "PuTTY-Local: " __DATE__ " " __TIME__;
51
52 #endif
53
54 /*
55 * SSH local version string MUST be under 40 characters. Here's a
56 * compile time assertion to verify this.
57 */
58 enum { vorpal_sword = 1 / (sizeof(sshver) <= 40) };