TZ_LICENSE = Public domain
TZ_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
+ifneq ($(TZ_LOCALTIME),)
+define TZ_SET_LOCALTIME
+ if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) ]; then \
+ printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
+ "$(TZ_LOCALTIME)"; \
+ exit 1; \
+ fi
+ ln -sf ../usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) $(TARGET_DIR)/etc/TZ
+endef
+endif
define TZ_BUILD_CMDS
(cd $(HOST_DIR)/share/zoneinfo/posix/; \
$(TARGET_DIR)/usr/share/zoneinfo/iso3166.tab
mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc
cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc
- if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) ]; then \
- printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
- "$(TZ_LOCALTIME)"; \
- exit 1; \
- fi
- ln -sf ../usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) $(TARGET_DIR)/etc/TZ
+ $(TZ_SET_LOCALTIME)
endef
$(eval $(generic-package))
endif
TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
+ifneq ($(TZDATA_LOCALTIME),)
+define TZDATA_SET_LOCALTIME
+ if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \
+ printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
+ "$(TZDATA_LOCALTIME)"; \
+ exit 1; \
+ fi
+ ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) $(TARGET_DIR)/etc/localtime
+ echo "$(TZDATA_LOCALTIME)" >$(TARGET_DIR)/etc/timezone
+endef
+endif
# No need to extract for target, we're using the host-installed files
TZDATA_EXTRACT_CMDS =
for zone in posix/*; do \
ln -sfn "$${zone}" "$${zone##*/}"; \
done
- if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \
- printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
- "$(TZDATA_LOCALTIME)"; \
- exit 1; \
- fi
- ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) $(TARGET_DIR)/etc/localtime
- echo "$(TZDATA_LOCALTIME)" >$(TARGET_DIR)/etc/timezone
+ $(TZDATA_SET_LOCALTIME)
endef
define HOST_TZDATA_BUILD_CMDS