Support SOURCE_DATE_EPOCH for reproducible builds

See https://reproducible-builds.org/docs/source-date-epoch/

Fixes #286
This commit is contained in:
Rangi
2020-12-16 11:08:18 -05:00
committed by Eldred Habert
parent 063a22ddf9
commit ad6f17cd93
4 changed files with 21 additions and 6 deletions

View File

@@ -655,7 +655,7 @@ static inline struct Symbol *createBuiltinSymbol(char const *name)
/*
* Initialize the symboltable
*/
void sym_Init(void)
void sym_Init(time_t now)
{
PCSymbol = createBuiltinSymbol("@");
struct Symbol *_NARGSymbol = createBuiltinSymbol("_NARG");
@@ -677,8 +677,6 @@ void sym_Init(void)
sym_AddEqu("__RGBDS_MINOR__", PACKAGE_VERSION_MINOR)->isBuiltin = true;
sym_AddEqu("__RGBDS_PATCH__", PACKAGE_VERSION_PATCH)->isBuiltin = true;
time_t now = time(NULL);
if (now == (time_t)-1) {
warn("Couldn't determine current time");
/* Fall back by pretending we are at the Epoch */