diff Makefile.am @ 24077:e483dcb5777d

build the source distribution archives reproducibly * Makefile.am (GZIP_ENV): Override default for a deterministic gzip. (SOURCE_MTIME): Define to the value printed by get-source-mtime.sh. (TAR_OPTIONS): Define to GNU tar options for making deterministic archives and export for tar to inherit by default. * build-aux/get-source-mtime.sh: New script. * build-aux/module.mk (EXTRA_DIST): Include it in the list. * m4/acinclude.m4 (OCTAVE_PROG_TAR_REPRODUCIBLE): New macro. * configure.ac: Use it.
author Mike Miller <mtmiller@octave.org>
date Thu, 21 Sep 2017 14:19:10 -0700
parents 3b68aeeabc40
children 1457c018b683
line wrap: on
line diff
--- a/Makefile.am	Tue Oct 11 15:20:35 2016 +0200
+++ b/Makefile.am	Thu Sep 21 14:19:10 2017 -0700
@@ -26,6 +26,7 @@
 export SED
 export SHELL
 export PERL
+export TAR_OPTIONS
 
 version := ${OCTAVE_VERSION}
 api_version := ${OCTAVE_API_VERSION}
@@ -80,6 +81,13 @@
 OCTAVE_GUI_LINK_DEPS = @OCTAVE_GUI_LINK_DEPS@
 OCTAVE_GUI_LINK_OPTS = @OCTAVE_GUI_LINK_OPTS@
 
+# Options used for creating the source distribution.
+
+GZIP_ENV = --best --no-name
+SOURCE_MTIME := \
+  $(shell $(SHELL) $(top_srcdir)/build-aux/get-source-mtime.sh "$(srcdir)")
+TAR_OPTIONS = $(REPRODUCIBLE_TAR_FLAGS) --mtime=@$(SOURCE_MTIME)
+
 # The arguments passed to configure.
 
 CONFIG_SUBDIRS = @subdirs@