aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-ar71xx/patches/0002-upstream-Makefile-Reproducible-U-Boot-build-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/boot/uboot-ar71xx/patches/0002-upstream-Makefile-Reproducible-U-Boot-build-support.patch')
-rw-r--r--package/boot/uboot-ar71xx/patches/0002-upstream-Makefile-Reproducible-U-Boot-build-support.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/package/boot/uboot-ar71xx/patches/0002-upstream-Makefile-Reproducible-U-Boot-build-support.patch b/package/boot/uboot-ar71xx/patches/0002-upstream-Makefile-Reproducible-U-Boot-build-support.patch
new file mode 100644
index 0000000000..664a4adb66
--- /dev/null
+++ b/package/boot/uboot-ar71xx/patches/0002-upstream-Makefile-Reproducible-U-Boot-build-support.patch
@@ -0,0 +1,31 @@
+--- a/Makefile
++++ b/Makefile
+@@ -389,8 +389,26 @@ $(VERSION_FILE):
+ @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
+
+ $(TIMESTAMP_FILE):
+- @date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
+- @date +'#define U_BOOT_TIME "%T"' >> $@
++ (if test -n "$${SOURCE_DATE_EPOCH}"; then \
++ SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
++ DATE=""; \
++ for date in gdate date.gnu date; do \
++ $${date} -u -d "$${SOURCE_DATE}" >/dev/null 2>&1 && DATE="$${date}"; \
++ done; \
++ if test -n "$${DATE}"; then \
++ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"' > $@; \
++ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"' >> $@; \
++ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"' >> $@; \
++ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"' >> $@; \
++ else \
++ return 42; \
++ fi; \
++ else \
++ LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
++ LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
++ LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
++ LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
++ fi)
+
+ gdbtools:
+ $(MAKE) -C tools/gdb all || exit 1