diff --git a/CHANGES b/CHANGES index 270257b..d77b669 100644 --- a/CHANGES +++ b/CHANGES @@ -97,6 +97,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 + testing: Do not distribute testcert.conf with socat source but generate it (and new testcert6.conf) during test.sh run. diff --git a/config.h.in b/config.h.in index b61e35e..47a408e 100644 --- a/config.h.in +++ b/config.h.in @@ -584,4 +584,6 @@ #undef WITH_MSGLEVEL +#define BUILD_DATE __DATE__ " " __TIME__ + #endif /* !defined(__config_h_included) */ diff --git a/configure.in b/configure.in index d34d6b1..76ee9fb 100644 --- a/configure.in +++ b/configure.in @@ -1863,4 +1863,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 daa07d9..8cb6767 100644 --- a/socat.c +++ b/socat.c @@ -70,7 +70,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