From 70d39f57146a6cb94736db39c770c3d95e07bedb Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Thu, 13 Aug 2015 18:08:27 +1200 Subject: [PATCH] Makefile: Use correct timezone for U_BOOT_TZ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When building with SOURCE_DATE_EPOCH the timezone is in UTC. When building normally the timezone is taken from the build machine's locale setting. Signed-off-by: Chris Packham Tested-by: Bin Meng Tested-by: Paul Kocialkowski Tested-by: Andreas Bießmann --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7b8efea231..e8ea71ca76 100644 --- a/Makefile +++ b/Makefile @@ -1280,10 +1280,16 @@ define filechk_version.h endef define filechk_timestamp.h - (SOURCE_DATE="$${SOURCE_DATE_EPOCH:+@$$SOURCE_DATE_EPOCH}"; \ - LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_DATE "%b %d %C%y"'; \ - LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TIME "%T"'; \ - LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TZ "%z"' ) + (if test -n "$${SOURCE_DATE_EPOCH}"; then \ + SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \ + 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"'; \ + 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"'; \ + fi) endef $(version_h): include/config/uboot.release FORCE -- 2.39.5