diff options
| author | Tobias Wiese <tobias@tobiaswiese.com> | 2020-08-07 17:49:20 +0200 |
|---|---|---|
| committer | Tobias Wiese <tobias@tobiaswiese.com> | 2020-08-07 17:49:20 +0200 |
| commit | fc513db3e8bca6be022e95a75723143cb6eca36e (patch) | |
| tree | ed8ba71adc957551e7e3c0a0a47593e7baf5f9b8 /src/exchange.c | |
| parent | 6b2f03de6f7b533c31d52523d49ede2f627d5bba (diff) | |
build: honor SOURCE_DATE_EPOCH
Use SOURCE_DATE_EPOCH as build timestamp if available, otherwise fall
back to the current time.
Previously the build timestamp were given in the --version output using
the C __DATE__ AND __TIME__ macros, which prevent a reproducible build.
Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'src/exchange.c')
| -rw-r--r-- | src/exchange.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/exchange.c b/src/exchange.c index e525e8f..c818606 100644 --- a/src/exchange.c +++ b/src/exchange.c @@ -38,8 +38,10 @@ Available Options:\n\ } void version() { - printf("%s %s\n", program_name, VERSION); - printf("Build on %s %s.\n", __DATE__, __TIME__); + printf("%s %s\n", program_name, VERSION); +#ifdef BUILD_DATE + printf("Build on %s.\n", BUILD_DATE); +#endif } #endif // !SMALL |
