zic.c compilation on OSF Tru64 Works with -std0 option

Paul Eggert eggert at twinsun.com
Fri Apr 20 02:18:38 UTC 2001


> Date: Wed, 18 Apr 2001 15:09:32 +0200
> From: francois reygagne <freygagne at opteway.com>
> 
> Could you upgrade your Makefile to take into account this update
> needed to complete successfully the tzcode binary generation for
> tyhe compaq OSF Tru64.

How about using the following patch instead?  It's a bit more generic.
It should address both the C compiler bug with 'const' that you ran
into with OSF1 cc, and the other problem that you mentioned with mkdir
on HP-UX.



===================================================================
RCS file: RCS/Makefile,v
retrieving revision 2001.2
diff -pu -r2001.2 Makefile
--- Makefile	2001/04/05 20:43:41	2001.2
+++ Makefile	2001/04/20 02:12:55
@@ -86,6 +86,7 @@ YEARISTYPE=	./yearistype
 LDLIBS=
 
 # Add the following to the end of the "CFLAGS=" line as needed.
+#  -Dconst= if `const' does not work (SunOS 4.x cc, OSF1 V5.0 cc)
 #  -DHAVE_ADJTIME=0 if `adjtime' does not exist (SVR0?)
 #  -DHAVE_GETTEXT=1 if `gettext' works (GNU, Linux, Solaris); also see LDLIBS
 #  -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
@@ -97,6 +98,7 @@ LDLIBS=
 #  -DHAVE_SETTIMEOFDAY=3 if settimeofday ignores 2nd arg (4.4BSD)
 #  -DHAVE_STRERROR=0 if your system lacks the strerror function
 #  -DHAVE_SYMLINK=0 if your system lacks the symlink function
+#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h"
 #  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
 #  -DLOCALE_HOME=\"path\" if locales are in "path", not "/usr/lib/locale"
 #  -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
===================================================================
RCS file: RCS/private.h,v
retrieving revision 2000.5
diff -pu -r2000.5 private.h
--- private.h	2000/07/31 13:27:54	2000.5
+++ private.h	2001/04/19 17:30:33
@@ -54,6 +54,10 @@ static char	privatehid[] = "@(#)private.
 #define HAVE_SYMLINK		1
 #endif /* !defined HAVE_SYMLINK */
 
+#ifndef HAVE_SYS_STAT_H
+#define HAVE_SYS_STAT_H		1
+#endif /* !defined HAVE_SYS_STAT_H */
+
 #ifndef HAVE_SYS_WAIT_H
 #define HAVE_SYS_WAIT_H		1
 #endif /* !defined HAVE_SYS_WAIT_H */
@@ -123,16 +127,6 @@ static char	privatehid[] = "@(#)private.
 */
 
 /*
-** SunOS 4.1.1 cc lacks const.
-*/
-
-#ifndef const
-#ifndef __STDC__
-#define const
-#endif /* !defined __STDC__ */
-#endif /* !defined const */
-
-/*
 ** SunOS 4.1.1 cc lacks prototypes.
 */
 
===================================================================
RCS file: RCS/zic.c,v
retrieving revision 2000.6
diff -pu -r2000.6 zic.c
--- zic.c	2000/08/10 13:31:47	2000.6
+++ zic.c	2001/04/19 17:15:47
@@ -7,9 +7,15 @@ static char	elsieid[] = "@(#)zic.c	7.101
 #include "private.h"
 #include "locale.h"
 #include "tzfile.h"
-#ifdef unix
-#include "sys/stat.h"			/* for umask manifest constants */
-#endif /* defined unix */
+
+#if HAVE_SYS_STAT_H
+#include "sys/stat.h"
+#endif
+#ifdef S_IRUSR
+#define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#else
+#define MKDIR_UMASK 0755
+#endif
 
 /*
 ** On some ancient hosts, predicates like `isspace(C)' are defined
@@ -2187,7 +2193,7 @@ char * const	argname;
 			** created by some other multiprocessor, so we get
 			** to do extra checking.
 			*/
-			if (mkdir(name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) != 0) {
+			if (mkdir(name, MKDIR_UMASK) != 0) {
 				const char *e = strerror(errno);
 
 				if (errno != EEXIST || !itsdir(name)) {



More information about the tz mailing list