1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2009 */
6 /* See the file NOTICE for conditions of use and distribution. */
8 /* Function for setting up the version string. */
15 /* The header file cnumber.h contains a single line containing the
16 compilation number, making it easy to have it updated automatically.
17 Hence the fudgery below to get the number turned into a string, since
18 we can't use #include inside a macro argument list */
23 static uschar cnumber_buffer[24];
24 static uschar date_buffer[32];
27 uschar *version_cnumber_format;
33 /* The odd magic after each of these is so they can be easily found
34 for automatic patching to standard values when running regression tests.
35 The reason that version_cnumber_format isn't just written inline in the
36 sprintf() call is the gcc -Wall warns about a \0 in a format string. */
38 version_cnumber = cnumber_buffer;
39 version_cnumber_format = US"%d\0<<eximcnumber>>";
40 sprintf(CS version_cnumber, CS version_cnumber_format, cnumber);
41 version_string = US EXIM_VERSION_STR "\0<<eximversion>>";
43 #ifdef EXIM_BUILD_DATE_OVERRIDE
44 /* Reproducible build support; build tooling should have given us something looking like
45 * "25-Feb-2017 20:15:40" in EXIM_BUILD_DATE_OVERRIDE based on $SOURCE_DATE_EPOCH in environ
46 * per <https://reproducible-builds.org/specs/source-date-epoch/>
48 version_date = date_buffer;
50 Ustrncat(version_date, EXIM_BUILD_DATE_OVERRIDE, sizeof(date_buffer));
53 Ustrcpy(today, __DATE__);
54 if (today[4] == ' ') today[4] = '0';
55 today[3] = today[6] = '-';
57 version_date = date_buffer;
59 Ustrncat(version_date, today+4, 3);
60 Ustrncat(version_date, today, 4);
61 Ustrncat(version_date, today+7, 4);
62 Ustrcat(version_date, " ");
63 Ustrcat(version_date, __TIME__);
67 /* End of version.c */