summary refs log tree commit diff
path: root/timezone
diff options
context:
space:
mode:
Diffstat (limited to 'timezone')
-rw-r--r--timezone/Makefile7
-rw-r--r--timezone/zdump.c12
2 files changed, 12 insertions, 7 deletions
diff --git a/timezone/Makefile b/timezone/Makefile
index 3f3f944e8b..410d3834db 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -53,7 +53,7 @@ define nl
 
 
 endef
-ifneq ($(no_deps),t)
+ifndef avoid-generated
 -include $(addprefix $(objpfx)z.,$(tzfiles))
 endif
 
@@ -158,9 +158,10 @@ $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
 
 tz-cflags = -DTZDIR='"$(zonedir)"' \
 	    -DTZDEFAULT='"$(localtime-file)"' \
-	    -DTZDEFRULES='"$(posixrules-file)"'
+	    -DTZDEFRULES='"$(posixrules-file)"' \
+	    -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
 
-CFLAGS-zdump.c = -Wno-strict-prototypes -DNOID
+CFLAGS-zdump.c = -Wno-strict-prototypes -DNOID $(tz-cflags)
 CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags)
 CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID
 CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID
diff --git a/timezone/zdump.c b/timezone/zdump.c
index f6480bb308..8c4f6ad1df 100644
--- a/timezone/zdump.c
+++ b/timezone/zdump.c
@@ -127,7 +127,7 @@ extern char *	optarg;
 extern int	optind;
 extern char *	tzname[2];
 
-static char *	abbr P((struct tm * tmp));
+static const char *abbr P((struct tm * tmp));
 static long	delta P((struct tm * newp, struct tm * oldp));
 static time_t	hunt P((char * name, time_t lot, time_t	hit));
 static size_t	longest;
@@ -358,15 +358,19 @@ int	v;
 	(void) printf("\n");
 }
 
-static char *
+static const char *
 abbr(tmp)
 struct tm *	tmp;
 {
-	register char *	result;
-	static char	nada;
+	register const char *result;
+	static const char nada;
 
+#ifdef TM_ZONE
+	result = tmp->TM_ZONE;
+#else /* !defined TM_ZONE */
 	if (tmp->tm_isdst != 0 && tmp->tm_isdst != 1)
 		return &nada;
 	result = tzname[tmp->tm_isdst];
+#endif /* !defined TM_ZONE */
 	return (result == NULL) ? &nada : result;
 }