about summary refs log tree commit diff
path: root/time
diff options
context:
space:
mode:
Diffstat (limited to 'time')
-rw-r--r--time/Banner1
-rw-r--r--time/Makefile35
-rw-r--r--time/README28
-rw-r--r--time/strftime.c27
4 files changed, 72 insertions, 19 deletions
diff --git a/time/Banner b/time/Banner
deleted file mode 100644
index eb972db206..0000000000
--- a/time/Banner
+++ /dev/null
@@ -1 +0,0 @@
-tzcode1997a and tzdata1997a by Arthur David Olson et. al.
diff --git a/time/Makefile b/time/Makefile
index 21ad62e071..7f8513cc6a 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -24,7 +24,7 @@ subdir	:= time
 headers	:= time.h sys/time.h sys/timeb.h timebits.h
 distribute := tzfile.h private.h scheck.c ialloc.c yearistype	\
 	      iso3166.tab zone.tab tzselect.ksh checktab.awk	\
-	      Banner
+	      README
 extra-objs = scheck.o ialloc.o $(tzfiles:%=z.%)
 
 routines	:= offtime asctime clock ctime ctime_r difftime	\
@@ -65,22 +65,22 @@ endef
 
 # Make these absolute file names.
 installed-localtime-file := $(firstword $(filter /%,$(localtime-file)) \
-					$(addprefix $(zonedir)/, \
+					$(addprefix $(inst_zonedir)/, \
 						    $(localtime-file)))
 installed-posixrules-file := $(firstword $(filter /%,$(posixrules-file)) \
-					 $(addprefix $(zonedir)/, \
+					 $(addprefix $(inst_zonedir)/, \
 						     $(posixrules-file)))
 
 ifeq ($(cross-compiling),no)
 # Don't try to install the zoneinfo files since we can't run zic.
-install-others = $(addprefix $(zonedir)/,$(zonenames) \
-					 $(zonenames:%=posix/%) \
-					 $(zonenames:%=right/%)) \
+install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
+					      $(zonenames:%=posix/%) \
+					      $(zonenames:%=right/%)) \
 		 $(installed-localtime-file) $(installed-posixrules-file)
 endif
 
 ifeq ($(have-ksh),yes)
-install-others += $(zonedir)/iso3166.tab $(zonedir)/zone.tab
+install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
 install-bin += tzselect
 endif
 
@@ -115,23 +115,23 @@ echo-zonenames:
 	@echo 'Known zones: $(zonenames)'
 
 
-# Although $(zonedir) gets compiled into zic, it is useful to always
-# specify it with -d on the command line so that it can be overridden on
-# the command line of `make install' (e.g., "make install prefix=/foo").
-zic-cmd = $(built-program-cmd) -d $(zonedir)
+# We have to use `-d $(inst_zonedir)' to explictly tell zic where to
+# place the output files although $(zonedir) is compiled in.  But the
+# user might have set $(install_root) on the command line of `make install'.
+zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
 	    -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
 
 # The source files specify the zone names relative to the -d directory,
-# so for the posix/ and right/ flavors we need to pass -d $(zonedir)/posix
+# so for the posix/ and right/ flavors we need to pass -d $(inst_zonedir)/posix
 # and the like.  This magic extracts /posix or /right if it's the first
-# component after $(zonedir) in the target name $@.
+# component after $(inst_zonedir) in the target name $@.
 target-zone-flavor = $(filter /posix /right, \
 			      /$(firstword $(subst /, , \
-					   $(patsubst $(zonedir)/%,%,$@))))
+					  $(patsubst $(inst_zonedir)/%,%,$@))))
 
 ifdef localtime
-$(installed-localtime-file): $(zonedir)/$(localtime) $(objpfx)zic
+$(installed-localtime-file): $(inst_zonedir)/$(localtime) $(objpfx)zic
 	$(make-target-directory)
 	if test -r $@; then \
 	  echo Site timezone NOT reset to Factory.; \
@@ -142,7 +142,7 @@ $(installed-localtime-file): $(zonedir)/$(localtime) $(objpfx)zic
 	fi
 endif
 ifdef posixrules
-$(installed-posixrules-file): $(zonedir)/$(posixrules) $(objpfx)zic
+$(installed-posixrules-file): $(inst_zonedir)/$(posixrules) $(objpfx)zic
 	$(zic-cmd) -p $(posixrules)
 endif
 
@@ -179,4 +179,5 @@ $(objpfx)tzselect: tzselect.ksh
 	chmod 555 $@.new
 	mv -f $@.new $@
 
-$(addprefix $(zonedir)/,iso3166.tab zone.tab): $(zonedir)/%: %; $(do-install)
+$(addprefix $(inst_zonedir)/,iso3166.tab zone.tab): $(inst_zonedir)/%: %
+	$(do-install)
diff --git a/time/README b/time/README
new file mode 100644
index 0000000000..3bd4e306ed
--- /dev/null
+++ b/time/README
@@ -0,0 +1,28 @@
+The sources files
+	`zic.c'
+	`zdump.c'
+	`tzselect.ksh'
+	`checktab.awk'
+files come from the tzcode1997a package by Arthur David Olsen et.al.
+
+The file
+	`africa'
+	`antarctica'
+	`asia'
+	`australasia'
+	`europe'
+	`northamerica'
+	`southamerica'
+	`pacificnew'
+	`etcetera'
+	`factory'
+	`backward'
+	`systemv'
+	`solar87'
+	`solar88'
+	`solar89'
+	`iso3166.tab'
+	`zone.tab'
+	`leapseconds'
+	`yearistype'
+files come from the tzdata1997a package by Arthur David Olsen et.al.
diff --git a/time/strftime.c b/time/strftime.c
index 56abd45240..ca3563c072 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -328,6 +328,31 @@ static char const month_name[][10] =
   };
 #endif
 
+
+#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
+  /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
+     Work around this bug by copying *tp before it might be munged.  */
+  size_t _strftime_copytm __P ((char *, size_t, const char *,
+			        const struct tm *));
+  size_t
+  strftime (s, maxsize, format, tp)
+      char *s;
+      size_t maxsize;
+      const char *format;
+      const struct tm *tp;
+  {
+    struct tm tmcopy;
+    tmcopy = *tp;
+    return _strftime_copytm (s, maxsize, format, &tmcopy);
+  }
+# ifdef strftime
+#  undef strftime
+# endif
+# define strftime(S, Maxsize, Format, Tp) \
+  _strftime_copytm ((S), (Maxsize), (Format), (Tp))
+#endif
+
+
 /* Write information from TP into S according to the format
    string FORMAT, writing no more that MAXSIZE characters
    (including the terminating '\0') and returning number of