aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-08-23 11:05:56 +0200
committerFelix Fietkau <nbd@nbd.name>2016-08-23 11:56:13 +0200
commitf5860f898a155c6e1f33813a8be7420135cb3481 (patch)
tree36bedb2b6dbbf261a83faf44bd7af3126dba936b
parent88b16da8c48231058682b5c0348c8e8eb0468c0c (diff)
downloadupstream-f5860f898a155c6e1f33813a8be7420135cb3481.tar.gz
upstream-f5860f898a155c6e1f33813a8be7420135cb3481.tar.bz2
upstream-f5860f898a155c6e1f33813a8be7420135cb3481.zip
build: use perl instead of GNU date for KBUILD_BUILD_TIMESTAMP
Fixes warning on non-Linux systems Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--include/kernel-defaults.mk8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index bae8cd0ee3..2c4bcec474 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -5,6 +5,12 @@
# See /LICENSE for more information.
#
+ifneq ($(SOURCE_DATE_EPOCH),)
+ ifndef DUMP
+ KBUILD_BUILD_TIMESTAMP:=$(shell perl -e 'print scalar gmtime($(SOURCE_DATE_EPOCH))')
+ endif
+endif
+
KERNEL_MAKEOPTS := -C $(LINUX_DIR) \
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
CROSS_COMPILE="$(KERNEL_CROSS)" \
@@ -12,7 +18,7 @@ KERNEL_MAKEOPTS := -C $(LINUX_DIR) \
KBUILD_HAVE_NLS=no \
KBUILD_BUILD_USER="$(call qstrip,$(CONFIG_KERNEL_BUILD_USER))" \
KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \
- $(if $(SOURCE_DATE_EPOCH),KBUILD_BUILD_TIMESTAMP="$(shell date -u --date="@$(SOURCE_DATE_EPOCH)")") \
+ KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \
KBUILD_BUILD_VERSION="0" \
CONFIG_SHELL="$(BASH)" \
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \