From ce75d9cf9cf406c9f08068b60af08707c56a024d Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Thu, 2 Apr 2015 17:02:47 +0200 Subject: [PATCH] Debian Bug 764251: Set the build timestamp to a deterministic time --- CHANGES | 4 ++++ config.h.in | 2 ++ configure.in | 7 +++++++ socat.c | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0af2d9e..df99da5 100644 --- a/CHANGES +++ b/CHANGES @@ -309,6 +309,10 @@ porting: broke cross compiling. The particular check gets reverted. Thanks to Ross Burton and Danomi Manchego for reporting this issue. + Debian Bug#764251: Set the build timestamp to a deterministic time: + support external BUILD_DATE env var to allow to build reproducable + binaries + new features: added option max-children that limits the number of concurrent child processes. Thanks to Sam Liddicott for providing the patch. diff --git a/config.h.in b/config.h.in index be94bd7..b02b8c1 100644 --- a/config.h.in +++ b/config.h.in @@ -589,4 +589,6 @@ #undef WITH_MSGLEVEL +#define BUILD_DATE __DATE__ " " __TIME__ + #endif /* !defined(__config_h_included) */ diff --git a/configure.in b/configure.in index 9430290..5e04eeb 100644 --- a/configure.in +++ b/configure.in @@ -1880,4 +1880,11 @@ if test -n "$WITH_FIPS"; then fi AC_SUBST(FIPSLD_CC) +# allow BUILD_DATE to be externally set for build reproducibility +if test "$BUILD_DATE"; then + AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"]) +else + AC_DEFINE(BUILD_DATE, [__DATE__" "__TIME__]) +fi + AC_OUTPUT(Makefile) diff --git a/socat.c b/socat.c index abe2c79..21d2ddd 100644 --- a/socat.c +++ b/socat.c @@ -50,7 +50,7 @@ static int socat_newchild(void); static const char socatversion[] = #include "./VERSION" ; -static const char timestamp[] = __DATE__" "__TIME__; +static const char timestamp[] = BUILD_DATE; const char copyright_socat[] = "socat by Gerhard Rieger - see www.dest-unreach.org"; #if WITH_OPENSSL