Author: Ole Streicher <olebole@debian.org>
Description: Allow to set build date for reproducibility
--- a/src/initsysvar.cpp
+++ b/src/initsysvar.cpp
@@ -44,6 +44,10 @@
 #include <sys/time.h>
 #endif
 
+#ifndef BUILD_DATE
+#define BUILD_DATE __DATE__
+#endif
+
 namespace SysVar
 {
 
@@ -479,11 +483,11 @@
     gdlStruct->NewTag("RELEASE", new DStringGDL( VERSION));
 
     // creating an explicit build date in !GDL (also exist in !version)
-    gdlStruct->NewTag("BUILD_DATE", new DStringGDL(__DATE__)); 
+    gdlStruct->NewTag("BUILD_DATE", new DStringGDL(BUILD_DATE));
 
     // creating and Epoch entry in order to have a simple incremental number 
     int CompilationMonth =0, CompilationYear=0, CompilationDay=0;
-    string MyDate= __DATE__;
+    string MyDate= BUILD_DATE;
     string SCompilationYear;
     SCompilationYear=MyDate.substr(7,4);
     CompilationYear=atoi(SCompilationYear.c_str());
@@ -719,7 +723,7 @@
     ver->NewTag("OS", new DStringGDL(SysName));    
     ver->NewTag("OS_NAME", new DStringGDL(SysName)); 
     ver->NewTag("RELEASE", new DStringGDL( "6.0")); 
-    ver->NewTag("BUILD_DATE", new DStringGDL(__DATE__)); 
+    ver->NewTag("BUILD_DATE", new DStringGDL(BUILD_DATE));
     ver->NewTag("MEMORY_BITS", new DIntGDL( sizeof(BaseGDL*)*8)); 
     ver->NewTag("FILE_OFFSET_BITS", new DIntGDL( sizeof(SizeT)*8)); 
     DVar *v            = new DVar( "VERSION", ver);
