From fc513db3e8bca6be022e95a75723143cb6eca36e Mon Sep 17 00:00:00 2001 From: Tobias Wiese Date: Fri, 7 Aug 2020 17:49:20 +0200 Subject: 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 --- src/exchange.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/exchange.c') 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 -- cgit v1.2.3