From: earle@elroy.jpl.nasa.gov (Greg Earle (Gainfully Unemployed))
Newsgroups: comp.unix.solaris,comp.unix.shell
Subject: Re: tcsh for Solaris 2.0 !
Summary: My own diffs
Date: 31 Aug 92 09:45:08 GMT
Followup-To: comp.unix.solaris
Organization: Gainfully Unemployed - I Am No Longer A Sun Employee - Hire Me

My own changes to the tcsh 6.02 sources seemed a little more complete than
Per's did (to me, anyway), so I'll post mine for the sake of comparison.

I created the file "config/config.solaris2" by copying "config.sysv4" and
simply undef'd BSDTIMES (I know they exist, but I wanted to try and avoid
any need for BSD Compatibility Mode, if possible).  I then linked config.h
to this new config/config.solaris2 file and let fly with "make".  So far,
no apparent problems.  Thank goodness Christos et al. did a previous SVR4
port (the WU archive "ftpd" port had been a nightmare, *sigh* ... ).

*** config/config.sysv4	Fri May 15 17:01:02 1992
--- config/config.solaris2	Thu Aug 20 11:18:46 1992
***************
*** 52,56 ****
   *		(OREO) has BSDJOBS and BSDSIGS but not BSDTIMES.
   */
! #define BSDTIMES
  
  /*
--- 52,56 ----
   *		(OREO) has BSDJOBS and BSDSIGS but not BSDTIMES.
   */
! #undef BSDTIMES
  
  /*

Here are my diffs for the rest of the 6.02 source.  They depend only on the
existing "SYSVREL" #define and do not introduce any new #define's.

The summary:
(1) Anywhere there's an "#ifdef (sun)" or "#if defined(sun) ... " construct,
    add in an appropriate "&& SYSVREL != 4"
(2) Solaris 2.0 signals are slightly different than existing implementations,
    so make small tweaks to sh.init.c
(3) Twiddle a couple of paths defined in the Makefile (like where "ctags" is,
    "vgrind", etc.)

The Makefile diffs are biased by my using Sun C 2.0 to compile it:

*** Makefile.orig	Fri May 15 17:00:52 1992
--- Makefile	Fri Aug 14 15:31:49 1992
***************
*** 95,102 ****
  ## LDLAGS.  Define something here if you need to
  ################################################################
! LDFLAGS= 			## The simplest, suitable for all.
  #LDFLAGS= -static -s		## Stripped. No shared libs. (linux)
  #LDFLAGS= -s			## Stripped. Takes less space on disk.
! #LDFLAGS= -s -n			## Pure executable. Spares paging over
  # 				## the network for machines with local
  #				## swap but external /usr/local/bin .
--- 95,102 ----
  ## LDLAGS.  Define something here if you need to
  ################################################################
! #LDFLAGS= 			## The simplest, suitable for all.
  #LDFLAGS= -static -s		## Stripped. No shared libs. (linux)
  #LDFLAGS= -s			## Stripped. Takes less space on disk.
! LDFLAGS= -s -n			## Pure executable. Spares paging over
  # 				## the network for machines with local
  #				## swap but external /usr/local/bin .
***************
*** 107,115 ****
  ## LIBES.  Pick one, or roll your own.
  ################################################################
! LIBES= -ltermcap		## BSD style things, hpux
  #LIBES= -ltermcap -lcs		## Mach
  #LIBES= -lcurses		## Sys V3 w/o networking (and Sys V4)
  #LIBES= -lcurses -lc /usr/ucblib/libucb.a ## Sys V4 with BSDTIMES
! #LIBES= -lcurses		## Sys V4 w/o BSDTIMES
  #LIBES= -lcurses -lnet		## Sys V3 with networking
  #LIBES= -lcurses -ldir		## Sys V2 w/o networking [needs directory lib]
--- 107,115 ----
  ## LIBES.  Pick one, or roll your own.
  ################################################################
! #LIBES= -ltermcap		## BSD style things, hpux
  #LIBES= -ltermcap -lcs		## Mach
  #LIBES= -lcurses		## Sys V3 w/o networking (and Sys V4)
  #LIBES= -lcurses -lc /usr/ucblib/libucb.a ## Sys V4 with BSDTIMES
! LIBES= -lcurses		## Sys V4 w/o BSDTIMES
  #LIBES= -lcurses -lnet		## Sys V3 with networking
  #LIBES= -lcurses -ldir		## Sys V2 w/o networking [needs directory lib]
***************
*** 147,152 ****
  # is fixed correctly, otherwise you'll be stopped for tty input, or you
  # will lose the editor and job control.
! CC=	gcc -Wall 
! #CC=	cc
  #CC=	occ
  #CC=	acc
--- 147,152 ----
  # is fixed correctly, otherwise you'll be stopped for tty input, or you
  # will lose the editor and job control.
! #CC=	gcc -Wall 
! CC=	cc
  #CC=	occ
  #CC=	acc
***************
*** 156,164 ****
  AS=	-as
  RM=	-rm
! CXREF=	/usr/ucb/cxref
! VGRIND=	csh /usr/ucb/vgrind
! CTAGS=	/usr/ucb/ctags
! #XSTR= /usr/ucb/xstr
! SCCS=	/usr/local/sccs
  PARALLEL=12				# Make the multi-max run fast.
  #P=&					# Use Sequent's parallel make
--- 156,166 ----
  AS=	-as
  RM=	-rm
! #CXREF=	/usr/ucb/cxref
! #VGRIND=	csh /usr/ucb/vgrind
! VGRIND=	csh /usr/bin/vgrind
! #CTAGS=	/usr/ucb/ctags
! CTAGS=	/usr/bin/ctags
! XSTR= /usr/ucb/xstr
! SCCS=	/usr/sccs
  PARALLEL=12				# Make the multi-max run fast.
  #P=&					# Use Sequent's parallel make
***************
*** 170,174 ****
  # DESTMAN=${DESTDIR}/usr/share/man/man${MANSECT} # Stardent Vistra (SysVR4)
  # DESTMAN=/usr/catman/1l	# Amiga unix (SysVR4)
! FTPAREA=/usr/spool/ftp
  
  ASSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
--- 172,176 ----
  # DESTMAN=${DESTDIR}/usr/share/man/man${MANSECT} # Stardent Vistra (SysVR4)
  # DESTMAN=/usr/catman/1l	# Amiga unix (SysVR4)
! FTPAREA=/export/ftp
  
  ASSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
*** sh.h.orig	Fri May 15 17:00:43 1992
--- sh.h	Sun Aug 23 12:23:54 1992
***************
*** 244,252 ****
  #endif /* SYSVREL > 0 ||  _IBMR2 */
  
! #if !((defined(sun) || defined(_MINIX)) && defined(TERMIO))
  # include <sys/ioctl.h>
  #endif 
  
! #if !defined(FIOCLEX) && defined(sun)
  # include <sys/filio.h>
  #endif /* !FIOCLEX && sun */
--- 244,252 ----
  #endif /* SYSVREL > 0 ||  _IBMR2 */
  
! #if !(((defined(sun) && SYSVREL != 4) || defined(_MINIX)) && defined(TERMIO))
  # include <sys/ioctl.h>
  #endif 
  
! #if !defined(FIOCLEX) && (defined(sun)  && SYSVREL != 4)
  # include <sys/filio.h>
  #endif /* !FIOCLEX && sun */
*** sh.init.c.orig	Fri May 15 17:00:40 1992
--- sh.init.c	Sun Aug 23 13:59:37 1992
***************
*** 267,271 ****
--- 267,275 ----
  # else
  /* 18 */	"CHLD",		"Child exited",
+ # if defined(sun) && (SYSVREL == 4)
+ /* 19 */	"LOST",		"Resource lost",
+ # else
  /* 19 */	"PWR",  	"Power failure",
+ # endif /* sun */
  # endif /* apollo */
  #endif /* IBMAIX && cray && linux */
***************
*** 434,439 ****
--- 438,450 ----
  /* 30 */	"XCPU",		"CPU time limit exceeded",
  /* 31 */	"XFSZ", 	"File size limit exceeded",
+ # ifdef sun
+ /* 32 */	"WAITING",	"Process's lwps are blocked",
+ /* 33 */	"LWP",		"Special LWP signal",
+ /* 34 */	0,		"Maximum number of signals",
+ # else
  /* 32 */	0,		"Maximum number of signals",
+ # endif /* sun */
  # endif /* SYSVREL > 3 */
+ 
  # if defined(ISC) && defined(POSIX) 
  #  define _sigextra_
*** sh.proc.c.orig	Fri May 15 17:00:41 1992
--- sh.proc.c	Sun Aug 23 14:09:56 1992
***************
*** 79,83 ****
  
  #ifdef BSDTIMES
! # if defined(sun) || defined(hp9000)
  static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0L, 0L, 0L, 0L,
  			    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
--- 79,83 ----
  
  #ifdef BSDTIMES
! # if (defined(sun) && SYSVREL != 4) || defined(hp9000)
  static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0L, 0L, 0L, 0L,
  			    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
*** sh.sem.c.orig	Fri May 15 17:00:42 1992
--- sh.sem.c	Sun Aug 23 12:39:17 1992
***************
*** 50,54 ****
  #endif /* FIOCLEX */
  
! #ifdef sparc
  # ifndef MACH
  #  include <vfork.h>
--- 50,54 ----
  #endif /* FIOCLEX */
  
! #if defined(sparc) && SYSVREL != 4
  # ifndef MACH
  #  include <vfork.h>
*** sh.time.c.orig	Fri May 15 17:00:42 1992
--- sh.time.c	Sun Aug 23 12:41:06 1992
***************
*** 39,43 ****
  RCSID("$Id: sh.time.c,v 3.7 1992/04/03 22:15:14 christos Exp $")
  
! #if defined(sun) && ! defined(MACH)
  # include <machine/param.h>
  #endif /* sun */
--- 39,43 ----
  RCSID("$Id: sh.time.c,v 3.7 1992/04/03 22:15:14 christos Exp $")
  
! #if defined(sun) && ! defined(MACH) && (SYSVREL != 4)
  # include <machine/param.h>
  #endif /* sun */
***************
*** 245,249 ****
   * the adjusting macro here:
   */
! #ifdef sun
  # define IADJUST(i)	(pagetok(i)/2)
  #else /* sun */
--- 245,249 ----
   * the adjusting macro here:
   */
! #if defined(sun) && SYSVREL != 4
  # define IADJUST(i)	(pagetok(i)/2)
  #else /* sun */
***************
*** 429,433 ****
  
  	    case 'M':		/* max. Resident Set Size */
! #ifdef sun
  # ifdef notdef
  		xprintf("%ld", r1->ru_maxrss * 1024L/(long) getpagesize());
--- 429,433 ----
  
  	    case 'M':		/* max. Resident Set Size */
! #if defined(sun) && SYSVREL != 4
  # ifdef notdef
  		xprintf("%ld", r1->ru_maxrss * 1024L/(long) getpagesize());
*** sh.types.h.orig	Fri May 15 17:00:51 1992
--- sh.types.h	Sun Aug 23 12:41:48 1992
***************
*** 50,54 ****
   *** Suns running sunos4.1
   ***/
! #ifdef sun
  /* This used to be long, but lint dissagrees... */
  # ifndef _SIGMASK_T
--- 50,54 ----
   *** Suns running sunos4.1
   ***/
! #if defined(sun) && SYSVREL != 4
  /* This used to be long, but lint dissagrees... */
  # ifndef _SIGMASK_T
*** tc.alloc.c.orig	Fri May 15 17:00:48 1992
--- tc.alloc.c	Sun Aug 23 12:42:20 1992
***************
*** 113,117 ****
  static union overhead *nextf[NBUCKETS];
  
! #ifdef sun
  extern ptr_t sbrk __P((int));
  #endif
--- 113,117 ----
  static union overhead *nextf[NBUCKETS];
  
! #if defined(sun) && SYSVREL != 4
  extern ptr_t sbrk __P((int));
  #endif
*** tc.os.h.orig	Fri May 15 17:00:50 1992
--- tc.os.h	Sun Aug 23 12:44:19 1992
***************
*** 338,342 ****
  # define mygetpgrp()    getpgrp(0)
  #else /* POSIX */
! # if defined(BSD) || defined(sun) || defined(IRIS4D)
  #  define mygetpgrp()    getpgrp(0)
  # else /* BSD || sun || IRIS4D */
--- 338,342 ----
  # define mygetpgrp()    getpgrp(0)
  #else /* POSIX */
! # if defined(BSD) || (defined(sun) && SYSVREL != 4) || defined(IRIS4D)
  #  define mygetpgrp()    getpgrp(0)
  # else /* BSD || sun || IRIS4D */
***************
*** 370,374 ****
  
  
! #if !defined(POSIX) || defined(sun)
  extern time_t time();
  extern char *getenv();
--- 370,374 ----
  
  
! #if !defined(POSIX) || (defined(sun) && SYSVREL != 4)
  extern time_t time();
  extern char *getenv();
***************
*** 484,488 ****
  #else /* POSIX */
  
! # if (defined(sun) && !defined(__GNUC__)) || defined(_IBMR2) || defined(_IBMESA)
  extern char *getwd();
  # endif	/* (sun && ! __GNUC__) || _IBMR2 || _IBMESA */
--- 484,488 ----
  #else /* POSIX */
  
! # if (defined(sun) && SYSVREL != 4 && !defined(__GNUC__)) || defined(_IBMR2) || defined(_IBMESA)
  extern char *getwd();
  # endif	/* (sun && ! __GNUC__) || _IBMR2 || _IBMESA */
***************
*** 495,499 ****
  #endif /* POSIX */
  
! # if defined(sun) && __GNUC__ == 2
  /*
   * Somehow these are missing
--- 495,499 ----
  #endif /* POSIX */
  
! # if defined(sun) && SYSVREL != 4 && __GNUC__ == 2
  /*
   * Somehow these are missing
*** tc.sig.h.orig	Fri May 15 17:00:51 1992
--- tc.sig.h	Sun Aug 23 12:44:59 1992
***************
*** 48,52 ****
  #endif				/* SYSVREL > 0 */
  
! #if defined(sun) || defined(DGUX)
  # define SAVESIGVEC
  #endif /* sun || DGUX */
--- 48,52 ----
  #endif				/* SYSVREL > 0 */
  
! #if (defined(sun) && SYSVREL != 4) || defined(DGUX)
  # define SAVESIGVEC
  #endif /* sun || DGUX */
Newsgroups: comp.unix.solaris,comp.sys.sun.misc,alt.sys.sun