summaryrefslogtreecommitdiff
path: root/debian/patches/gcc-SOURCE_DATE_EPOCH-doc.diff
blob: f5ea3c8144d22ba76329c88da8b07173daf7f87d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# DP: Allow embedded timestamps by C/C++ macros to be set externally (docs)

gcc/ChangeLog:

2016-04-27  Eduard Sanou  <dhole@openmailbox.org>
	    Matthias Klose  <doko@debian.org>

	* doc/cppenv.texi: Document SOURCE_DATE_EPOCH environment variable.

--- a/src/gcc/doc/cppenv.texi
+++ b/src/gcc/doc/cppenv.texi
@@ -79,4 +79,21 @@
 @ifclear cppmanual
 @xref{Preprocessor Options}.
 @end ifclear
+
+@item SOURCE_DATE_EPOCH
+
+If this variable is set, its value specifies a UNIX timestamp to be
+used in replacement of the current date and time in the @code{__DATE__}
+and @code{__TIME__} macros, so that the embedded timestamps become
+reproducible.
+
+The value of @env{SOURCE_DATE_EPOCH} must be a UNIX timestamp,
+defined as the number of seconds (excluding leap seconds) since
+01 Jan 1970 00:00:00 represented in ASCII, identical to the output of
+@samp{@command{date +%s}}.
+
+The value should be a known timestamp such as the last modification
+time of the source or package and it should be set by the build
+process.
+
 @end vtable