Make problem (archives)

Matt Crawford matt at oddjob.UUCP
Mon Feb 24 12:25:27 AEST 1986


The make syntaxes "a(b)" and "a((b))" don't even come
close to working in the 4.2 make.  The following fixes
the former only.  In /usr/src/bin/make:

RCS file: RCS/files.c,v
retrieving revision 1.1
diff -c -r1.1 files.c
*** /tmp/,RCSt1003671	Sun Feb 23 20:16:33 1986
--- files.c	Sun Feb 23 20:16:21 1986
***************
*** 372,378
  
  static long arflen;
  static long arfdate;
! static char arfname[16];
  FILE *arfd;
  long int arpos, arlen;
  

--- 372,378 -----
  
  static long arflen;
  static long arfdate;
! static char arfname[16];		/* size S/B determined from ar.h */
  FILE *arfd;
  long int arpos, arlen;
  
***************
*** 414,420
  	{
  	if(objarch)
  		{
! 		getobj();
  		nsym = objhead.a_syms / sizeof(objentry);
  		for(i = 0; i<nsym ; ++i)
  			{

--- 414,421 -----
  	{
  	if(objarch)
  		{
! 		if( !getobj() )
! 			continue;	/* not a .o file (eg: __.SYMDEF) */
  		nsym = objhead.a_syms / sizeof(objentry);
  		for(i = 0; i<nsym ; ++i)
  			{
***************
*** 484,489
  getarch()
  {
  	struct ar_hdr arhead;
  	long atol();
  
  arpos += (arflen + 1) & ~1L;	/* round archived file length up to even */

--- 485,491 -----
  getarch()
  {
  	struct ar_hdr arhead;
+ 	char *p;
  	long atol();
  
  arpos += (arflen + 1) & ~1L;	/* round archived file length up to even */
***************
*** 501,506
  	arfdate = arhead.ar_date;
  #endif
  	strncpy(arfname, arhead.ar_name, sizeof(arhead.ar_name));
  return(1);
  }
  

--- 503,511 -----
  	arfdate = arhead.ar_date;
  #endif
  	strncpy(arfname, arhead.ar_name, sizeof(arhead.ar_name));
+ 	p = &arfname[sizeof(arhead.ar_name)];
+ 	while( *--p == ' ' )
+ 		*p = '\0';		/* trim for eqstr */
  return(1);
  }
  
***************
*** 511,517
  
  fread( (char *) &objhead, sizeof(objhead), 1, arfd);
  if (N_BADMAG(objhead))
! 	fatal1("%s is not an object module", arfname);
  skip = objhead.a_text + objhead.a_data;
  #if defined(vax) || defined(sun)
  skip += objhead.a_trsize + objhead.a_drsize;

--- 516,522 -----
  
  fread( (char *) &objhead, sizeof(objhead), 1, arfd);
  if (N_BADMAG(objhead))
! 	return 0;
  skip = objhead.a_text + objhead.a_data;
  #if defined(vax) || defined(sun)
  skip += objhead.a_trsize + objhead.a_drsize;
***************
*** 520,525
  	skip *= 2;
  #endif
  fseek(arfd, skip, 1);
  }
  
  

--- 525,531 -----
  	skip *= 2;
  #endif
  fseek(arfd, skip, 1);
+ return 1;
  }
  
  
***************
*** 528,534
  int n;
  {
  register int i;
! for(i = 0 ; i < n ; ++i)
  	if(*a++ != *b++)
  		return(NO);
  return(YES);

--- 534,540 -----
  int n;
  {
  register int i;
! for(i = 0 ; i < n && (*a || *b) ; ++i)
  	if(*a++ != *b++)
  		return(NO);
  return(YES);
_____________________________________________________
Matt		University	crawford at anl-mcs.arpa
Crawford	of Chicago	ihnp4!oddjob!matt



More information about the Comp.unix mailing list