From: Chris Lamb Date: Tue, 13 Aug 2019 20:52:26 +0000 (-0700) Subject: Make the build reproducible X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4c0ff1bf81a69284ec8767dacc2ee69d30741f6;p=re2c Make the build reproducible Whilst working on the Reproducible Builds effort [0] we noticed that re2c could not be built reproducibly. This is because it used the current build date in the manual page and was originally filed in Debian as #934697 [1]. This patch uses the SOURCE_DATE_EPOCH [2] environment variable. [0] https://reproducible-builds.org/ [1] https://bugs.debian.org/934697 [2] https://reproducible-builds.org/specs/source-date-epoch/ Signed-off-by: Chris Lamb --- diff --git a/configure.ac b/configure.ac index 0be3373d..7a59c30e 100644 --- a/configure.ac +++ b/configure.ac @@ -6,8 +6,12 @@ AM_SILENT_RULES([yes]) AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_HEADERS([config.h]) - -AC_SUBST(PACKAGE_DATE, `date +'%d %b %Y'`) +if test -n "$SOURCE_DATE_EPOCH"; then + PACKAGE_DATE=`LC_ALL=C date --utc --date="@$SOURCE_DATE_EPOCH" +'%b %d %Y'` +else + PACKAGE_DATE=`date +'%d %b %Y'` +fi +AC_SUBST(PACKAGE_DATE, $PACKAGE_DATE) AC_SUBST(PACKAGE_VERSION) AC_SUBST(PACKAGE_NAME) AC_SUBST(PACKAGE_TARNAME)