From d620005fd1a655d591fccb44639e22ea445e4554 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 23 Sep 2014 18:34:32 -0400 Subject: Allow ./configure to explicitly set libgpg-error's build timestamp * configure.ac: add --enable-build-timestamp -- A group within Debian is working on making the archive rebuildable in a reproducible way, so that the compiled binary outputs are byte-for-byte identical when built for the same platform using the same toolchain. This is useful in providing auditability and corroboration for users of the operating system. libgpg-error is very close to reproducible except for embedding the build timestamp in the generated binary. This timestamp is set in config.h during ./configure. This patch allows an external build system to set this embedded timestamp explicitly, which appears to make the package build repeatably when ./configure is called with (for example) --enable=build-timestamp=2014-09-23T01:02+0000 Debian-bug-id: 762397 (Minor reformatting and NEWS entry by wk.) --- NEWS | 4 +++- configure.ac | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 80975ad..e3c2097 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,9 @@ Noteworthy changes in version 1.17 (unreleased) [C12/A12/R_] ----------------------------------------------- - * Add an errot source code for an TLS protocol library. + * New error source code for TLS protocol libraries. + + * New configure option --enable-build-timestamp. * Interface changes relative to the 1.16 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/configure.ac b/configure.ac index b32b751..4652a2b 100644 --- a/configure.ac +++ b/configure.ac @@ -484,7 +484,17 @@ changequote([,])dnl BUILD_FILEVERSION="${BUILD_FILEVERSION}0,mym4_revision_dec" AC_SUBST(BUILD_FILEVERSION) -BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` + +AC_ARG_ENABLE([build-timestamp], + AC_HELP_STRING([--enable-build-timestamp], + [set an explicit build timestamp for reproducibility. + (default is the current time in ISO-8601 format)]), + [if test "$enableval" = "no"; then + BUILD_TIMESTAMP="" + else + BUILD_TIMESTAMP="$enableval" + fi], + [BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`]) AC_SUBST(BUILD_TIMESTAMP) AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP", [The time this package was configured for a build]) -- cgit v1.2.3