Article View: gnu.utils.bug
Article #393ranlib port to USG
From: Alexander Dupuy
Date: Thu, 31 Aug 1989 20:34
Date: Thu, 31 Aug 1989 20:34
122 lines
3337 bytes
3337 bytes
The ranlib provided in the binutils distribution of Mar 10 1989 does not
compile on USG systems. The context diff attached contains the changes to make
it compile on USG systems.
@alex
*** /tmp/,RCSt1a13605 Thu Aug 31 16:30:47 1989
--- ranlib.c Thu Aug 31 16:17:40 1989
***************
*** 2,11 ****
`ar rs LIBRARY' for each library specified. */
#include <ar.h>
- #include <sys/time.h>
- #include <sys/file.h>
#include <stdio.h>
void touch_symdefs ();
/* The makefile generates a -D switch to define AR_PROG
--- 2,18 ----
`ar rs LIBRARY' for each library specified. */
#include <ar.h>
#include <stdio.h>
+ #ifdef USG
+ #include <time.h>
+ #include <fcntl.h>
+ #define bzero(p,n) memset(p,0,n)
+ #else
+ #include <sys/file.h>
+ #include <sys/time.h>
+ #endif
+
void touch_symdefs ();
/* The makefile generates a -D switch to define AR_PROG
***************
*** 46,57 ****
int largc;
char **largv;
{
! struct timeval tv;
! struct timezone tz;
struct ar_hdr archive_header;
int i, rr;
! gettimeofday (&tv, &tz);
while (largc--)
{
--- 53,63 ----
int largc;
char **largv;
{
! long tv;
struct ar_hdr archive_header;
int i, rr;
! time (&tv);
while (largc--)
{
***************
*** 65,71 ****
continue;
}
! lseek (fd, SARMAG, L_SET);
rr = read (fd, &archive_header, sizeof (archive_header));
--- 71,77 ----
continue;
}
! lseek (fd, SARMAG, 0);
rr = read (fd, &archive_header, sizeof (archive_header));
***************
*** 81,99 ****
bzero ((char *) archive_header.ar_date,
sizeof (archive_header.ar_date));
! sprintf (archive_header.ar_date, "%d", tv.tv_sec);
for (i = 0; i < sizeof archive_header.ar_date; i++)
if (archive_header.ar_date[i] == '\0')
archive_header.ar_date[i] = ' ';
! lseek (fd, - rr, L_INCR);
write (fd, &archive_header, sizeof (archive_header));
close (fd);
break;
}
! lseek (fd, atoi (archive_header.ar_size), L_INCR);
rr = read (fd, &archive_header, sizeof (archive_header));
}
--- 87,105 ----
bzero ((char *) archive_header.ar_date,
sizeof (archive_header.ar_date));
! sprintf (archive_header.ar_date, "%d", tv);
for (i = 0; i < sizeof archive_header.ar_date; i++)
if (archive_header.ar_date[i] == '\0')
archive_header.ar_date[i] = ' ';
! lseek (fd, - rr, 1);
write (fd, &archive_header, sizeof (archive_header));
close (fd);
break;
}
! lseek (fd, atoi (archive_header.ar_size), 1);
rr = read (fd, &archive_header, sizeof (archive_header));
}
Technical Details
Message-ID:
<8908312034.AA13751@cs.columbia.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!CS.COLUMBIA.EDU!dupuyShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!CS.COLUMBIA.EDU!dupuy From: dupuy@CS.COLUMBIA.EDU (Alexander Dupuy) Newsgroups: gnu.utils.bug Subject: ranlib port to USG Message-ID: <8908312034.AA13751@cs.columbia.edu> Date: 31 Aug 89 20:34:07 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: dupuy@cs.columbia.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 122