]> gitweb.factorcode.org Git - factor.git/commitdiff
vm/master.hpp: optional reproducible VM compilation 2115/head
authorCat Stevens <catb0t@protonmail.ch>
Wed, 20 Feb 2019 19:29:32 +0000 (14:29 -0500)
committerCat Stevens <catb0t@protonmail.ch>
Wed, 20 Feb 2019 20:50:06 +0000 (15:50 -0500)
The old behaviour of building with `__DATE__` and
    `__TIME__` is still the default, but now it's
    possible to use `-DREPRODUCIBLE=1` and the
    `REPRODUCIBLE=1` parameter to `make` and `nmake`.

Specifically, this replaces the value of
    `FACTOR_COMPILE_TIME` with the string constant
    `"[reproducible]"`. This is purely a cosmetic
    change.

GNUmakefile
Nmakefile
vm/master.hpp

index 53a1f0b8b5c09eead07c2cfb823079a8f72912f4..595a6c90eff5662dafdcd48a72252fc5545e7960 100644 (file)
@@ -1,6 +1,7 @@
 ifdef CONFIG
        VERSION = 0.99
        GIT_LABEL = $(shell echo `git describe --all`-`git rev-parse HEAD`)
+       REPRODUCIBLE ?= 0
 
        BUNDLE = Factor.app
 
@@ -10,6 +11,7 @@ ifdef CONFIG
                -pedantic \
                -DFACTOR_VERSION="$(VERSION)" \
                -DFACTOR_GIT_LABEL="$(GIT_LABEL)" \
+               -DFACTOR_REPRODUCIBLE="$(REPRODUCIBLE)" \
                $(SITE_CFLAGS)
 
        CXXFLAGS += -std=c++11
index 0b0ce667779d214bc3e3d1e48228d1e3423bc03e..441c7875e185c46007357c63e6371b7cd0b8183a 100644 (file)
--- a/Nmakefile
+++ b/Nmakefile
@@ -65,6 +65,10 @@ LINK_FLAGS = $(LINK_FLAGS) /DEBUG
 CL_FLAGS = $(CL_FLAGS) /Zi /DFACTOR_DEBUG
 !ENDIF
 
+!IF DEFINED(REPRODUCIBLE)
+CL_FLAGS = $(CL_FLAGS) /DFACTOR_REPRODUCIBLE=1
+!ENDIF
+
 ML_FLAGS = /nologo /safeseh
 
 EXE_OBJS = vm\main-windows.obj vm\factor.res
index 4c87f74b97e3845a224a49a1734967ce255e8070..7fd7b18a4690799c82d44363287144d5800b5df1 100644 (file)
 #define FACTOR_COMPILER_VERSION "unknown"
 #endif
 
-// Record compilation time
-#define FACTOR_COMPILE_TIME __DATE__ " " __TIME__
+#if (FACTOR_REPRODUCIBLE == 1)
+  #pragma message "REPRODUCIBLE"
+  #define FACTOR_COMPILE_TIME "[reproducible]"
+#else
+  // Record compilation time
+  #define FACTOR_COMPILE_TIME  __DATE__ " " __TIME__
+#endif
 
 // Detect target CPU type
 #if defined(__arm__)