Browse Source

Support reproducible builds

Dmitry Marakasov 5 years ago
parent
commit
f0e3a1b132
2 changed files with 7 additions and 1 deletions
  1. 3
    1
      Makefile
  2. 4
    0
      mptsd.c

+ 3
- 1
Makefile View File

@@ -1,8 +1,10 @@
1 1
 CC = $(CROSS)$(TARGET)gcc
2 2
 STRIP = $(CROSS)$(TARGET)strip
3
-BUILD_ID = $(shell date +%F_%R)
4 3
 VERSION="v1.1"
4
+ifndef REPRODUCIBLE_BUILD
5
+BUILD_ID = $(shell date +%F_%R)
5 6
 GIT_VER = $(shell git describe --tags --dirty --always 2>/dev/null)
7
+endif
6 8
 CFLAGS = -ggdb -Wall -Wextra -Wshadow -Wformat-security -Wno-strict-aliasing -O2 -D_GNU_SOURCE -DBUILD_ID=\"$(BUILD_ID)\"
7 9
 ifneq "$(GIT_VER)" ""
8 10
 CFLAGS += -DGIT_VER=\"$(GIT_VER)\"

+ 4
- 0
mptsd.c View File

@@ -34,7 +34,11 @@
34 34
 
35 35
 #define PROGRAM_NAME "ux-mptsd"
36 36
 
37
+#ifdef BUILD_ID
37 38
 const char *program_id = PROGRAM_NAME " " GIT_VER " build " BUILD_ID;
39
+#else
40
+const char *program_id = PROGRAM_NAME " " GIT_VER;
41
+#endif
38 42
 
39 43
 char *server_sig = PROGRAM_NAME;
40 44
 char *server_ver = GIT_VER;

Loading…
Cancel
Save