]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: allow to override build date
authorBernhard M. Wiedemann <bwiedemann@suse.de>
Thu, 5 Oct 2017 12:13:53 +0000 (14:13 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 5 Oct 2017 16:18:07 +0000 (18:18 +0200)
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

configure

index 45eddf15ded2c9d5868e791237e58a6c828f9eaf..7b57992d7c9ee42336d17474ba5145f2a0e7b604 100755 (executable)
--- a/configure
+++ b/configure
@@ -550,7 +550,11 @@ then
     split_seconds=$ntp_era_split
     split_days=0
   else
-    split_seconds=`date '+%s'`
+    if [ "x$SOURCE_DATE_EPOCH" != "x" ]; then
+      split_seconds=$SOURCE_DATE_EPOCH
+    else
+      split_seconds=`date '+%s'`
+    fi
     if [ "x$split_seconds" = "x" ]; then
       echo "error: could not get current time, --with-ntp-era option is needed"
       exit 1