Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!iuvax!sahayman From: sahayman@iuvax.cs.indiana.edu (Steve Hayman) Newsgroups: comp.lang.perl Subject: patch 7 /usr/include/utime.h check doesn't work on Ultrix 3.1 (+Fix) Message-ID: <32017@iuvax.cs.indiana.edu> Date: 22 Dec 89 21:33:35 GMT Reply-To: sahayman@iuvax.cs.indiana.edu (Steve Hayman) Organization: Computer Science Department, Indiana University Lines: 120 Patch 7 adds code to Configure to check for /usr/include/utime.h, on the assumption that DG/UX is the only Unix that has this. Unfortunately, Ultrix 3.1 has a slightly incompatible file by the same name. The Ultrix file declares struct utimbuf { time_t actime; time_t modtime; }; and apparently the DG/UX one also declares "acusec" and "modusec" fields. So "doio.c" won't compile under Ultrix 3.1 . One quick fix would be to change Configure to check not only for /usr/include/utime.h but also for "acusec" in that file, and define two different symbols. Here's a patch for Configure, config.h.SH and doio.c that does that. Hope it's of use to someone. *** Configure.old Fri Dec 22 15:50:09 1989 --- Configure Fri Dec 22 15:39:44 1989 *************** *** 176,181 **** --- 176,182 ---- i_systime='' d_systimekernel='' i_utime='' + i_utimeacusec='' i_varargs='' i_vfork='' intsize='' *************** *** 2217,2228 **** fi : see if this is DG/UX with a funky utime.h echo " " if $test -r /usr/include/utime.h ; then i_utime="$define" ! echo "utime.h found." else i_utime="$undef" echo "No utime.h found, but that's ok." fi --- 2218,2240 ---- fi : see if this is DG/UX with a funky utime.h + + : also make sure the file contains 'acusec', since the ultrix one does not + : sahayman@iuvax.cs.indiana.edu + echo " " if $test -r /usr/include/utime.h ; then i_utime="$define" ! if $contains acusec /usr/include/utime.h >/dev/null 2>&1 ; then ! i_utimeacusec="$define" ! echo "utime.h found." ! else ! echo "utime.h found, but it doesn't declare 'acusec', that's ok." ! i_utimeacusec="$undef" ! fi else i_utime="$undef" + i_utimeacusec="$undef" echo "No utime.h found, but that's ok." fi *************** *** 2605,2610 **** --- 2617,2623 ---- i_systime='$i_systime' d_systimekernel='$d_systimekernel' i_utime='$i_utime' + i_utimeacusec='$i_utimeacusec' i_varargs='$i_varargs' i_vfork='$i_vfork' intsize='$intsize' *** config.h.SH.old Fri Dec 22 15:55:48 1989 --- config.h.SH Fri Dec 22 15:56:11 1989 *************** *** 544,550 **** --- 544,558 ---- * This symbol, if defined, indicates to the C program that it should * include utime.h (a DG/UX thingie). */ + /* + * I_UTIMEACUSEC: + * This symbol, if defined, indicates that utime.h includes an + * "acusec" field. Ultrix also has a utime.h file but only the + * DG/UX one defines "acusec". sahayman@iuvax.cs.indiana.edu + */ #$i_utime I_UTIME /**/ + #$i_utimeacusec I_UTIMEACUSEC /**/ + /* I_VARARGS: * This symbol, if defined, indicates to the C program that it should *** doio.c.old Fri Dec 22 15:50:16 1989 --- doio.c Fri Dec 22 15:40:44 1989 *************** *** 1993,2000 **** utbuf.actime = (long)str_gnum(st[++sp]); /* time accessed */ utbuf.modtime = (long)str_gnum(st[++sp]); /* time modified */ ! #ifdef I_UTIME ! utbuf.acusec = 0; /* hopefully I_UTIME implies these */ utbuf.modusec = 0; #endif items -= 2; --- 1993,2000 ---- utbuf.actime = (long)str_gnum(st[++sp]); /* time accessed */ utbuf.modtime = (long)str_gnum(st[++sp]); /* time modified */ ! #if defined(I_UTIME) && defined(I_UTIMEACUSEC) ! utbuf.acusec = 0; /* not all utime.h's define these */ utbuf.modusec = 0; #endif items -= 2;