[comp.unix.aux] UW server now runs on A/UX

dwb@Apple.COM (David W. Berry) (08/04/88)

What follows is a shar file containing makefiles and a patch
file for uw 4.2 that allow it to compile and execute under
A/UX

	Enjoy!

	David


#! /bin/sh
##  This is a shell archive.  Remove anything before this line, then unpack
##  it by saving it into a file and typing "sh file".  To overwrite existing
##  files, type "sh file -c".  You can also feed this as standard input via
##  unshar, or by typing "sh <file".  If this archive is complete, you will
##  see the following message at the end:
#		"End of shell archive."
# Contents:  uw.aux/uw.diffs uw.aux/lib/Makefile_aux
#   uw.aux/server/Makefile_aux uw.aux/utility/Makefile_aux
# Wrapped by dwb@apple.apple.com on Wed Aug  3 16:50:28 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f uw.aux/uw.diffs -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"uw.aux/uw.diffs\"
else
echo shar: Extracting \"uw.aux/uw.diffs\" \(18160 characters\)
sed "s/^X//" >uw.aux/uw.diffs <<'END_OF_uw.aux/uw.diffs'
Xdiff -rc uw.4.2/DEFINES uw.aux/DEFINES
X*** uw.4.2/DEFINES	Sat Jul 30 14:07:55 1988
X--- uw.aux/DEFINES	Tue Feb  2 16:53:24 1988
X***************
X*** 1 ****
X!  -DUTMP
X--- 1 ----
X!  -DAUX
Xdiff -rc uw.4.2/Makefile uw.aux/Makefile
X*** uw.4.2/Makefile	Sat Jul 30 14:07:15 1988
X--- uw.aux/Makefile	Tue Feb  2 16:52:12 1988
X***************
X*** 32,49 ****
X  BINDIR	=	/usr/local/bin
X  INCDIR	=	/usr/include/uw
X  LIBDIR	=	/usr/local/lib
X! VERSION	=	4.3
X  
X! DEFINES	=	-DUTMP
X  
X! #MKFILES	=	server/Makefile lib/Makefile utility/Makefile hqx/Makefile
X! MKFILES	=	server/Makefile lib/Makefile utility/Makefile
X  
X  all:	DEFINES $(MKFILES)
X  	cd server; make
X  	cd lib; make
X  	cd utility; make
X! #	cd hqx; make
X  
X  depend:
X  	cd server; make depend
X--- 32,48 ----
X  BINDIR	=	/usr/local/bin
X  INCDIR	=	/usr/include/uw
X  LIBDIR	=	/usr/local/lib
X! VERSION	=	aux
X  
X! DEFINES	=	-DAUX
X  
X! MKFILES	=	server/Makefile lib/Makefile utility/Makefile hqx/Makefile
X  
X  all:	DEFINES $(MKFILES)
X  	cd server; make
X  	cd lib; make
X  	cd utility; make
X! 	cd hqx; make
X  
X  depend:
X  	cd server; make depend
X***************
X*** 51,63 ****
X  	cd utility; make depend
X  
X  install:	all
X  	ln -s `pwd`/h $(INCDIR)
X! 	install -s server/uw $(BINDIR)/uw
X! 	install -s utility/uwtool $(BINDIR)/uwtool
X! 	install -s utility/uwtitle $(BINDIR)/uwtitle
X! 	install -s utility/uwterm $(BINDIR)/uwterm
X! 	install -s utility/uwplot $(BINDIR)/uwplot
X! 	cp lib/libuw.a $(LIBDIR); ranlib $(LIBDIR)/libuw.a
X  
X  clean:
X  	cd server; make clean
X--- 50,60 ----
X  	cd utility; make depend
X  
X  install:	all
X+ 	rm -f $(INCDIR)
X  	ln -s `pwd`/h $(INCDIR)
X! 	cp server/uw utility/uwtool utility/uwtitle utility/uwterm utility/uwplot \
X! 		$(BINDIR)
X! 	cp lib/libuw.a $(LIBDIR)
X  
X  clean:
X  	cd server; make clean
XOnly in uw.aux/lib: Makefile_aux
Xdiff -rc uw.4.2/lib/uw_fork.c uw.aux/lib/uw_fork.c
X*** uw.4.2/lib/uw_fork.c	Sat Feb 27 14:36:09 1988
X--- uw.aux/lib/uw_fork.c	Mon Feb  1 19:10:42 1988
X***************
X*** 5,17 ****
X--- 5,27 ----
X   * copy this program is given provided that the copy is not sold and that
X   * this copyright notice is included.
X   */
X+ #include <stdio.h>
X  #include <sys/types.h>
X  #include <sys/socket.h>
X+ #ifdef AUX
X+ #include <net/un.h>
X+ #else
X  #include <sys/un.h>
X+ #endif
X  #include <sys/ioctl.h>
X  #include <sys/uio.h>
X  #include <sys/file.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #include <termio.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <signal.h>
X  #include "openpty.h"
X  
X***************
X*** 32,40 ****
X--- 42,55 ----
X  	auto int fd;
X  	char *portal;
X  	int lmode, ldisc;
X+ #ifdef AUX
X+ 	struct termio termio;
X+ 	struct ltchars ltc;
X+ #else
X  	struct sgttyb sg;
X  	struct tchars tc;
X  	struct ltchars ltc;
X+ #endif
X  	struct iovec iov;
X  	struct msghdr msg;
X  	struct sockaddr_un sa;
X***************
X*** 58,70 ****
X--- 73,103 ----
X  	 * provide defaults in case it is not.
X  	 */
X  	if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
X+ #ifdef AUX
X+ 		(void)ioctl(fd, (int) TCGETA, (char *) &termio);
X+ 		(void)ioctl(fd, (int) TIOCGLTC, (char *) &ltc);
X+ #else
X  		(void)ioctl(fd, (int)TIOCGETP, (char *)&sg);
X  		(void)ioctl(fd, (int)TIOCGETC, (char *)&tc);
X  		(void)ioctl(fd, (int)TIOCGLTC, (char *)&ltc);
X  		(void)ioctl(fd, (int)TIOCLGET, (char *)&lmode);
X  		(void)ioctl(fd, (int)TIOCGETD, (char *)&ldisc);
X+ #endif
X  		(void)close(fd);
X  	} else {
X+ #ifdef AUX
X+ 		termio.c_iflag = BRKINT | ISTRIP | ICRNL | IXON | IXOFF | IXANY;
X+ 		termio.c_oflag = OPOST | ONLCR;
X+ 		termio.c_cflag = CS8 | HUPCL | SSPEED;
X+ 		termio.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL;
X+ 		termio.c_line = 0;
X+ 		termio.c_cc[VINTR] = CINTR;
X+ 		termio.c_cc[VQUIT] = CQUIT;
X+ 		termio.c_cc[VERASE] = CERASE;
X+ 		termio.c_cc[VKILL] = CKILL;
X+ 		termio.c_cc[VEOF] = CEOF;
X+ 		termio.c_cc[VSWTCH] = CSWTCH;
X+ #endif
X  		/* ... */
X  	}
X  
X***************
X*** 127,132 ****
X--- 160,168 ----
X  		env_set(env);
X  		(void)signal(SIGTSTP, SIG_IGN);
X  		(void)ioctl(open("/dev/tty", 2), (int)TIOCNOTTY, (char *)0);
X+ #ifdef AUX
X+ 		(void)setpgrp(0, getpid());
X+ #endif
X  		(void)close(open(pt.pt_tname, 0)); /*set new ctrl tty */
X  		(void)dup2(pt.pt_tfd, 0);
X  		(void)dup2(0, 1);
X***************
X*** 134,144 ****
X--- 170,185 ----
X  		fd = getdtablesize();
X  		while (--fd > 2)
X  			(void)close(fd);
X+ #ifdef AUX
X+ 		(void)ioctl(0, TCSETA, &termio);
X+ 		(void)ioctl(0, TIOCSLTC, &ltc);
X+ #else
X  		(void)ioctl(fd, (int)TIOCSETD, (char *)&ldisc);
X  		(void)ioctl(0, (int)TIOCSETN, (char *)&sg);
X  		(void)ioctl(0, (int)TIOCSETC, (char *)&tc);
X  		(void)ioctl(0, (int)TIOCSLTC, (char *)&ltc);
X  		(void)ioctl(0, (int)TIOCLSET, (char *)&lmode);
X+ #endif
X  		uwerrno = UWE_NONE;
X  		return(0);
X  	}
Xdiff -rc uw.4.2/lib/uw_gtitle.c uw.aux/lib/uw_gtitle.c
X*** uw.4.2/lib/uw_gtitle.c	Sat Feb 27 14:36:10 1988
X--- uw.aux/lib/uw_gtitle.c	Mon Feb  1 19:10:40 1988
X***************
X*** 5,11 ****
X--- 5,15 ----
X   * copy this program is given provided that the copy is not sold and that
X   * this copyright notice is included.
X   */
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include "uwlib.h"
X  
X  uw_gtitle(uwin, ttl)
Xdiff -rc uw.4.2/lib/uw_netadj.c uw.aux/lib/uw_netadj.c
X*** uw.4.2/lib/uw_netadj.c	Sat Feb 27 14:36:10 1988
X--- uw.aux/lib/uw_netadj.c	Mon Feb  1 19:10:38 1988
X***************
X*** 7,13 ****
X--- 7,17 ----
X   */
X  #include <sys/types.h>
X  #include <sys/socket.h>
X+ #ifdef AUX
X+ #include <net/un.h>
X+ #else
X  #include <sys/un.h>
X+ #endif
X  #include <sys/ioctl.h>
X  #include <sys/wait.h>
X  #include <sys/time.h>
X***************
X*** 15,21 ****
X--- 19,29 ----
X  #include <sys/uio.h>
X  #include <sys/file.h>
X  #include <netinet/in.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <signal.h>
X  #include "openpty.h"
X  
Xdiff -rc uw.4.2/lib/uw_new.c uw.aux/lib/uw_new.c
X*** uw.4.2/lib/uw_new.c	Sat Feb 27 14:36:11 1988
X--- uw.aux/lib/uw_new.c	Mon Feb  1 19:10:37 1988
X***************
X*** 9,15 ****
X--- 9,19 ----
X  #include <sys/socket.h>
X  #include <netinet/in.h>
X  #include <sys/uio.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <signal.h>
X  #include <netdb.h>
X  #include <ctype.h>
Xdiff -rc uw.4.2/lib/uw_options.c uw.aux/lib/uw_options.c
X*** uw.4.2/lib/uw_options.c	Sat Feb 27 14:36:11 1988
X--- uw.aux/lib/uw_options.c	Mon Feb  1 19:10:36 1988
X***************
X*** 9,15 ****
X--- 9,19 ----
X  #include <sys/file.h>
X  #include <sys/time.h>
X  #include <netinet/in.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <signal.h>
X  #include <errno.h>
X  
Xdiff -rc uw.4.2/lib/uw_rsetopt.c uw.aux/lib/uw_rsetopt.c
X*** uw.4.2/lib/uw_rsetopt.c	Sat Feb 27 14:36:11 1988
X--- uw.aux/lib/uw_rsetopt.c	Tue Feb  2 16:25:47 1988
X***************
X*** 7,17 ****
X--- 7,25 ----
X   */
X  #include <sys/types.h>
X  #include <sys/socket.h>
X+ #ifdef AUX
X+ #include <net/un.h>
X+ #else
X  #include <sys/un.h>
X+ #endif
X  #include <sys/ioctl.h>
X  #include <sys/uio.h>
X  #include <sys/file.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <signal.h>
X  #include "openpty.h"
X  
Xdiff -rc uw.4.2/lib/uw_ttype.c uw.aux/lib/uw_ttype.c
X*** uw.4.2/lib/uw_ttype.c	Sat Feb 27 14:36:12 1988
X--- uw.aux/lib/uw_ttype.c	Tue Feb  2 16:25:17 1988
X***************
X*** 5,11 ****
X--- 5,15 ----
X   * copy this program is given provided that the copy is not sold and that
X   * this copyright notice is included.
X   */
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include "uwlib.h"
X  
X  struct table {
XOnly in uw.aux/server: Makefile_aux
Xdiff -rc uw.4.2/server/openpty.c uw.aux/server/openpty.c
X*** uw.4.2/server/openpty.c	Sat Feb 27 14:36:02 1988
X--- uw.aux/server/openpty.c	Tue Feb  2 16:09:40 1988
X***************
X*** 19,25 ****
X--- 19,29 ----
X  #include <sys/types.h>
X  #include <sys/dir.h>
X  #include <fcntl.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include "openpty.h"
X  
X  #define	DEV_DIR		"/dev"		/* directory where devices live */
Xdiff -rc uw.4.2/server/uw_ipc.c uw.aux/server/uw_ipc.c
X*** uw.4.2/server/uw_ipc.c	Sat Feb 27 14:36:03 1988
X--- uw.aux/server/uw_ipc.c	Tue Feb  2 16:08:56 1988
X***************
X*** 10,20 ****
X--- 10,28 ----
X  #include <sys/file.h>
X  #include <sys/stat.h>
X  #include <sys/socket.h>
X+ #ifdef AUX
X+ #include <net/un.h>
X+ #else
X  #include <sys/un.h>
X+ #endif
X  #include <sys/ioctl.h>
X  #include <sys/uio.h>
X  #include <netinet/in.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <netdb.h>
X  #include <errno.h>
X  #include <stdio.h>
Xdiff -rc uw.4.2/server/uw_main.c uw.aux/server/uw_main.c
X*** uw.4.2/server/uw_main.c	Sat Feb 27 14:36:03 1988
X--- uw.aux/server/uw_main.c	Tue Feb  2 16:17:22 1988
X***************
X*** 15,21 ****
X--- 15,25 ----
X  #include <pwd.h>
X  #include <signal.h>
X  #include <errno.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <stdio.h>
X  
X  #include "uw_param.h"
X***************
X*** 44,49 ****
X--- 48,57 ----
X  	extern int optind;
X  	extern char *optarg;
X  
X+ #ifdef AUX
X+ 	set42sig();
X+ #endif
X+ 	
X  	/*
X  	 * Make sure we don't accidentally try to run this inside itself.
X  	 */
X***************
X*** 174,180 ****
X  		}
X  		for (fd=0; fd < nfds; fd++) {
X  			if (FD_ISSET(fd, &selmask[1].sm_rd)) {
X! 				switch (fdmap[fd].f_type) {
X  				case FDT_MAC:
X  					PCL_RECV(0, (char *)0, 0);
X  					break;
X--- 182,188 ----
X  		}
X  		for (fd=0; fd < nfds; fd++) {
X  			if (FD_ISSET(fd, &selmask[1].sm_rd)) {
X! 				switch ((int) fdmap[fd].f_type) {
X  				case FDT_MAC:
X  					PCL_RECV(0, (char *)0, 0);
X  					break;
X***************
X*** 303,308 ****
X--- 311,319 ----
X  			(void)signal(SIGCHLD, SIG_DFL);
X  			(void)ioctl(open("/dev/tty",O_RDWR),
X  			    (int)TIOCNOTTY, (char *)0);
X+ #ifdef AUX
X+ 			(void) setpgrp(0, getpid());
X+ #endif
X  			(void)open(pt.pt_tname, O_RDONLY);
X  			for (fd=3; fd < nfds; fd++)
X  				(void)close(fd);
X***************
X*** 352,358 ****
X--- 363,371 ----
X  	 * descriptors, but it causes no harm.
X  	 */
X  	pcl_exit(0);
X+ #ifdef UTMP
X  	utmp_exit();
X+ #endif
X  	fd_exit();
X  	ipc_exit();
X  	tty_mode(0);
X***************
X*** 364,375 ****
X  {
X  	register int pid;
X  	union wait status;
X  	struct rusage rusage;
X! 
X  	/*
X  	 * Collect dead children.  Restart any children that have stopped.
X  	 */
X  	while ((pid=wait3(&status, WNOHANG|WUNTRACED, &rusage)) > 0)
X  		if (WIFSTOPPED(status))
X  			(void)kill(pid, SIGCONT);
X  }
X--- 377,394 ----
X  {
X  	register int pid;
X  	union wait status;
X+ #ifndef AUX
X  	struct rusage rusage;
X! #endif
X! 	
X  	/*
X  	 * Collect dead children.  Restart any children that have stopped.
X  	 */
X+ #ifdef AUX
X+ 	while ((pid=wait3(&status, WNOHANG|WUNTRACED)) > 0)
X+ #else
X  	while ((pid=wait3(&status, WNOHANG|WUNTRACED, &rusage)) > 0)
X+ #endif
X  		if (WIFSTOPPED(status))
X  			(void)kill(pid, SIGCONT);
X  }
Xdiff -rc uw.4.2/server/uw_tty.c uw.aux/server/uw_tty.c
X*** uw.4.2/server/uw_tty.c	Sat Feb 27 14:36:04 1988
X--- uw.aux/server/uw_tty.c	Mon Feb  1 19:10:31 1988
X***************
X*** 8,14 ****
X--- 8,18 ----
X  
X  #include <sys/types.h>
X  #include <sys/file.h>
X+ #ifdef AUX
X+ #include <sys/termio.h>
X+ #else
X  #include <sys/ioctl.h>
X+ #endif
X  #include <sys/stat.h>
X  
X  #include "uw_param.h"
X***************
X*** 101,109 ****
X--- 105,160 ----
X  struct emulation ansi_emul = { TTY_WOPT, tty_start, tty_stop, tty_setext };
X  struct emulation tek_emul = { { 0, 0, 0, 0, 0 }, tty_start, tty_stop };
X  
X+ #ifdef AUX
X  tty_mode(f)
X  int f;
X  {
X+ 	static struct termio		oldtio, newtio;
X+ 	static struct ltchars		oltchars, nltchars;
X+ 	static				saved;
X+ 
X+ 	if(f == 1)
X+ 	{
X+ 		if(ioctl(0, (int) TCGETA, &oldtio))
X+ 		{
X+ 			perror("ioctl(TCGETA)");
X+ 			done(1);
X+ 		}
X+ 		if (ioctl(0, (int)TIOCGLTC, (char *)&oltchars) < 0) {
X+ 			perror("ioctl((int)TIOCGLTC)");
X+ 			done(1);
X+ 		}
X+ 		newtio.c_iflag = IXON|IXOFF;
X+ 		newtio.c_oflag = 0;
X+ 		newtio.c_cflag = oldtio.c_cflag & ~CREAD;
X+ 		newtio.c_lflag = 0;
X+ 		memset(newtio.c_cc, -1, sizeof(newtio.c_cc));
X+ 		newtio.c_cc[VMIN] = 1;
X+ 		newtio.c_cc[VTIME] = 0;
X+ 		memset(&nltchars, -1, sizeof(nltchars));
X+ 		if(ioctl(0, (int) TCSETA, &newtio))
X+ 		{
X+ 			perror("ioctl(TCSETA) (botch)");
X+ 			done(1);
X+ 		}
X+ 		if (ioctl(0, (int)TIOCSLTC, (char *)&nltchars) < 0) {
X+ 			perror("ioctl((int)TIOCSLTC");
X+ 			done(1);
X+ 		}
X+ 		saved++;
X+ 	}
X+ 	else if(saved)
X+ 	{
X+ 	    if(ioctl(0, (int) TCSETA, &oldtio))
X+ 		perror("ioctl(TCSETA) (restore)");
X+ 	    if(ioctl(0, (int)TIOCSLTC, (char *)&oltchars))
X+ 		perror("ioctl(TIOCSLTC) (restore)");
X+ 	}
X+ }
X+ #else
X+ tty_mode(f)
X+ int f;
X+ {
X  	static struct sgttyb ostty, nstty;
X  	static struct tchars otchars, ntchars;
X  	static struct ltchars oltchars, nltchars;
X***************
X*** 183,188 ****
X--- 234,240 ----
X  			(void)fchmod(0, operm);
X  	}
X  }
X+ #endif
X  
X  static
X  tty_start(w)
Xdiff -rc uw.4.2/server/uw_utmp.c uw.aux/server/uw_utmp.c
X*** uw.4.2/server/uw_utmp.c	Sat Feb 27 14:36:04 1988
X--- uw.aux/server/uw_utmp.c	Mon Feb  1 19:10:29 1988
X***************
X*** 13,19 ****
X--- 13,23 ----
X  #include <sys/time.h>
X  #include <pwd.h>
X  #include <utmp.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <ctype.h>
X  #include <stdio.h>
X  
X***************
X*** 193,199 ****
X  {
X  }
X  
X! utmp_exit()
X  {
X  }
X  #endif
X--- 197,203 ----
X  {
X  }
X  
X! utmp_rmall()
X  {
X  }
X  #endif
Xdiff -rc uw.4.2/server/uw_win.c uw.aux/server/uw_win.c
X*** uw.4.2/server/uw_win.c	Sat Feb 27 14:36:04 1988
X--- uw.aux/server/uw_win.c	Mon Feb  1 19:10:28 1988
X***************
X*** 10,16 ****
X--- 10,20 ----
X  #include <sys/file.h>
X  #include <sys/ioctl.h>
X  #include <signal.h>
X+ #ifdef AUX
X+ #include <string.h>
X+ #else
X  #include <strings.h>
X+ #endif
X  #include <stdio.h>
X  
X  #include "openpty.h"
X***************
X*** 177,182 ****
X--- 181,189 ----
X  				(void)signal(SIGCHLD, SIG_DFL);
X  				(void)ioctl(open("/dev/tty",O_RDWR),
X  				    (int)TIOCNOTTY, (char *)0);
X+ #ifdef AUX
X+ 				(void) setpgrp(0, getpid());
X+ #endif
X  				(void)close(open(pt.pt_tname, O_RDONLY));
X  				(void)setuid(getuid());
X  				if (!(shell = getenv("SHELL")))
XOnly in uw.aux/utility: Makefile_aux
Xdiff -rc uw.4.2/utility/uwterm.c uw.aux/utility/uwterm.c
X*** uw.4.2/utility/uwterm.c	Sat Feb 27 14:35:54 1988
X--- uw.aux/utility/uwterm.c	Mon Feb  1 19:10:27 1988
X***************
X*** 7,13 ****
X--- 7,17 ----
X   */
X  #include <sys/types.h>
X  #include <sys/file.h>
X+ #ifdef AUX
X+ #include <sys/termio.h>
X+ #else
X  #include <sys/ioctl.h>
X+ #endif
X  #include <sys/socket.h>
X  #include <sys/time.h>
X  #include <sys/resource.h>
X***************
X*** 14,20 ****
X--- 18,26 ----
X  #include <sys/wait.h>
X  #include <netinet/in.h>
X  #include <signal.h>
X+ #ifndef AUX
X  #include <strings.h>
X+ #endif
X  #include <ctype.h>
X  #include <errno.h>
X  #include <stdio.h>
X***************
X*** 64,69 ****
X--- 70,78 ----
X  	struct sockaddr_in sa, *sin;
X  	char hostname[32];
X  
X+ #ifdef AUX
X+ 	set42sig();
X+ #endif
X  	/*
X  	 * If called with no arguments, create a new window using the
X  	 * current shell according to the SHELL environment variable
X***************
X*** 340,347 ****
X--- 349,360 ----
X  register int ptyfd;
X  {
X  	register int ttyfd;
X+ #ifdef AUX
X+ 	struct termio termio;
X+ #else
X  	struct sgttyb sg;
X  	struct tchars tc;
X+ #endif
X  	struct ltchars ltc;
X  	int ldisc;
X  	int lmode;
X***************
X*** 351,356 ****
X--- 364,402 ----
X  	 * is "ptyfd" to the same modes as the current terminal.  If there
X  	 * isn't a "current terminal" handy, then use hardcoded defaults.
X  	 */
X+ #ifdef AUX
X+ 	for(ttyfd = 0 ; ttyfd < 3 && ioctl(ttyfd, TCGETA, &termio) < 0 ; ttyfd++)
X+ 	    ;
X+ 	if(ttyfd < 3)
X+ 	{
X+ 	    (void) ioctl(ttyfd, TIOCGLTC, &ltc);
X+ 	}
X+ 	else
X+ 	{
X+ 	    termio.c_iflag = ICRNL | IXON | IXOFF | IXANY;
X+ 	    termio.c_oflag = OPOST | ONLCR;
X+ 	    termio.c_cflag = B9600 | CS8;
X+ 	    termio.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL;
X+ 	    
X+ 	    termio.c_cc[VINTR] = CINTR;
X+ 	    termio.c_cc[VQUIT] = CQUIT;
X+ 	    termio.c_cc[VERASE] = CERASE;
X+ 	    termio.c_cc[VKILL] = CKILL;
X+ 	    termio.c_cc[VEOF] = CEOF;
X+ 	    termio.c_cc[VEOL] = -1;
X+ 	    termio.c_cc[VSWTCH] = CNSWTCH;
X+ 
X+ 	    ltc.t_suspc = CTL('z');
X+ 	    ltc.t_dsuspc = CTL('y');
X+ 	    ltc.t_rprntc = CTL('r');
X+ 	    ltc.t_flushc = CTL('o');
X+ 	    ltc.t_werasc = CTL('w');
X+ 	    ltc.t_lnextc = CTL('v');
X+ 	}
X+ 	
X+ 	(void)ioctl(ptyfd, TCSETA, &termio);
X+ 	(void)ioctl(ptyfd, TIOCSLTC, &ltc);
X+ #else
X  	for (ttyfd=0; ttyfd < 3 && ioctl(ttyfd, TIOCGETD, &ldisc) < 0; ttyfd++)
X  		;
X  	if (ttyfd < 3) {
X***************
X*** 387,392 ****
X--- 433,439 ----
X  	(void)ioctl(ptyfd, TIOCSETC, &tc);
X  	(void)ioctl(ptyfd, TIOCSLTC, &ltc);
X  	(void)ioctl(ptyfd, TIOCLSET, &lmode);
X+ #endif
X  }
X  
X  adjenv(term, sin, wid)
Xdiff -rc uw.4.2/utility/uwtitle.c uw.aux/utility/uwtitle.c
X*** uw.4.2/utility/uwtitle.c	Sat Feb 27 14:35:54 1988
X--- uw.aux/utility/uwtitle.c	Mon Feb  1 19:10:23 1988
X***************
X*** 5,11 ****
X--- 5,13 ----
X   * copy this program is given provided that the copy is not sold and that
X   * this copyright notice is included.
X   */
X+ #ifndef AUX
X  #include <strings.h>
X+ #endif
X  #include <stdio.h>
X  
X  #include "uwlib.h"
X***************
X*** 28,33 ****
X--- 30,39 ----
X  	char *cqlimit;
X  	union uwoptval uwoptval;
X  
X+ #ifdef AUX
X+ 	set42sig();
X+ #endif
X+ 	
X  	/*
X  	 * If called with no arguments, print a syntax message.  Otherwise,
X  	 * set the title of the current window to argv[1..argc-1].  The
Xdiff -rc uw.4.2/utility/uwtool.c uw.aux/utility/uwtool.c
X*** uw.4.2/utility/uwtool.c	Sat Feb 27 14:35:54 1988
X--- uw.aux/utility/uwtool.c	Mon Feb  1 19:10:22 1988
X***************
X*** 5,11 ****
X--- 5,13 ----
X   * copy this program is given provided that the copy is not sold and that
X   * this copyright notice is included.
X   */
X+ #ifndef AUX
X  #include <strings.h>
X+ #endif
X  #include <stdio.h>
X  
X  #include "uwlib.h"
X***************
X*** 29,34 ****
X--- 31,40 ----
X  	extern char *optarg;
X  	extern char *getenv();
X  
X+ #ifdef AUX
X+ 	set42sig();
X+ #endif
X+ 	
X  	/*
X  	 * If called with no arguments, create a new window using the
X  	 * current shell according to the SHELL environment variable
END_OF_uw.aux/uw.diffs
if test 18160 -ne `wc -c <uw.aux/uw.diffs`; then
    echo shar: \"uw.aux/uw.diffs\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f uw.aux/lib/Makefile_aux -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"uw.aux/lib/Makefile_aux\"
else
echo shar: Extracting \"uw.aux/lib/Makefile_aux\" \(1668 characters\)
sed "s/^X//" >uw.aux/lib/Makefile_aux <<'END_OF_uw.aux/lib/Makefile_aux'
X#! /bin/make -f
X#
X#	uw library makefile (4.3BSD)
X#
X# INCDIR names the directory in which header files are located.
X# SERVERDIR names the directory containing the server source.
X# SERVER_OBJS names the object files derived from sources in SERVERDIR.
X# OBJECTS names all of the object files required for the library.
X#
X
XINCDIR	=	../h
X
XSERVERDIR =	../server
X
XSERVER_OBJS =	$(SERVERDIR)/openpty.o $(SERVERDIR)/uw_env.o
X
XOBJECTS	=	uw_cmd.o uw_close.o uw_detach.o uw_fork.o uw_kill.o \
X		uw_netadj.o uw_new.o uw_optcmd.o uw_optfn.o uw_options.o \
X		uw_perror.o uw_ttype.o \
X		uw_rsetopt.o uw_shell.o \
X		uw_gvis.o uw_gtype.o uw_gtitle.o uw_gwsize.o uw_gpos.o \
X		$(SERVER_OBJS)
X
XSOURCES	=	`echo $(OBJECTS) | sed -e 's/\.o/\.c/g'`
X
XDEFINES	=	`cat ../DEFINES`
X
XCFLAGS	=	-O -I$(INCDIR) $(DEFINES)
X
XTARGET	=	libuw.a
X
X$(TARGET):	$(OBJECTS)
X	ar cr $(TARGET) $(OBJECTS)
X	-if [ ! -f uwlib.a ];then ln -s libuw.a uwlib.a;fi
X
X$(SERVER_OBJS):
X	cd $(SERVERDIR); make `basename $@`
X
Xlint:
X	lint -uhbx -I$(INCDIR) $(DEFINES) $(SOURCES)
X
Xtags:
X	ctags $(SOURCES)
X
Xsources:
X	echo $(SOURCES)
X
Xdepend: 
X	$(CC) -M -I$(INCDIR) $(DEFINES) $(SOURCES) | \
X	sed -e ':loop' \
X	    -e 's/\.\.\/[^ /]*\/\.\./../' \
X	    -e 't loop' | \
X	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
X		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
X		       else rec = rec " " $$2 } } \
X	      END { print rec } ' >> makedep
X	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
X	echo '$$r makedep' >>eddep
X	echo 'w' >>eddep
X	cp Makefile Makefile.bak
X	ex - Makefile < eddep
X	rm eddep makedep
X
Xclean:
X	-rm *.o
X
X# DO NOT DELETE THIS LINE (or the following blank line) -- make depend uses it
X
END_OF_uw.aux/lib/Makefile_aux
if test 1668 -ne `wc -c <uw.aux/lib/Makefile_aux`; then
    echo shar: \"uw.aux/lib/Makefile_aux\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f uw.aux/server/Makefile_aux -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"uw.aux/server/Makefile_aux\"
else
echo shar: Extracting \"uw.aux/server/Makefile_aux\" \(1168 characters\)
sed "s/^X//" >uw.aux/server/Makefile_aux <<'END_OF_uw.aux/server/Makefile_aux'
X#! /bin/make -f
X#
X#	uw makefile (4.3BSD)
X#
X# INCDIR names the directory where the header files are located.
X#
X# OBJECTS names all of the object files required for the server.
X#
X
XINCDIR	=	../h
X
XOBJECTS	=	uw_clk.o uw_env.o uw_fd.o uw_ipc.o uw_main.o uw_opt.o \
X		uw_pcl.o uw_tty.o uw_utmp.o uw_win.o openpty.o
X
XSOURCES	=	`echo $(OBJECTS) | sed -e 's/\.o/\.c/g'`
X
XDEFINES	=	`cat ../DEFINES`
X
XCFLAGS	=	$(DEFINES) -I$(INCDIR) -O
XLFLAGS	=
X
Xuw:		$(OBJECTS)
X	$(CC) $(LFLAGS) -o uw $(OBJECTS) $(LIBS)
X
Xlint:
X	lint -hbx -I$(INCDIR) $(DEFINES) $(SOURCES)
X
Xtags:
X	ctags $(SOURCES)
X
Xdepend: 
X	$(CC) -M -I$(INCDIR) $(DEFINES) $(SOURCES) | \
X	sed -e ':loop' \
X	    -e 's/\.\.\/[^ /]*\/\.\./../' \
X	    -e 't loop' | \
X	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
X		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
X		       else rec = rec " " $$2 } } \
X	      END { print rec } ' >> makedep
X	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
X	echo '$$r makedep' >>eddep
X	echo 'w' >>eddep
X	cp Makefile Makefile.bak
X	ex - Makefile < eddep
X	rm eddep makedep
X
Xclean:
X	rm *.o
X
X# DO NOT DELETE THIS LINE (or the following blank line) -- make depend uses it
X
END_OF_uw.aux/server/Makefile_aux
if test 1168 -ne `wc -c <uw.aux/server/Makefile_aux`; then
    echo shar: \"uw.aux/server/Makefile_aux\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f uw.aux/utility/Makefile_aux -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"uw.aux/utility/Makefile_aux\"
else
echo shar: Extracting \"uw.aux/utility/Makefile_aux\" \(1858 characters\)
sed "s/^X//" >uw.aux/utility/Makefile_aux <<'END_OF_uw.aux/utility/Makefile_aux'
X#! /bin/make -f
X#
X#	uw utility makefile (4.3BSD)
X#
X#	INCDIR should be set to the directory containing header files.
X#
X#	LIBUW should be set to the name of the library file (or, if it is
X#	installed in a system directory, "-luw").
X#
X#	Note: in order for "uwterm" to work on remote machines it is
X#	necessary for it to be installed in a directly where "rsh"
X#	will find it.  The #defined symbol UWTERM in the source can
X#	be set to the desired absolute pathname, if necessary.
X#
X
XINCDIR	=	../h
X
XLIBUW	=	../lib/libuw.a
X
XUWTOOL_OBJS =	uwtool.o
XUWTITLE_OBJS =	uwtitle.o
XUWTERM_OBJS =	uwterm.o
XUWPLOT_OBJS =	uwplot.o
X
XOBJECTS	=	$(UWTOOL_OBJS) $(UWTITLE_OBJS) $(UWTERM_OBJS) $(UWPLOT_OBJS)
X
XSOURCES	=	`echo $(OBJECTS) | sed -e 's/\.o/\.c/g'`
X
XDEFINES	=	`cat ../DEFINES`
X
XCFLAGS	=	-O -I$(INCDIR) $(DEFINES)
XLFLAGS	=
X
Xall:		uwtool uwtitle uwterm uwplot
X
Xuwtool:		$(UWTOOL_OBJS)
X	$(CC) -o $@ $(LFLAGS) $(UWTOOL_OBJS) $(LIBUW)
X
Xuwtitle:	$(UWTITLE_OBJS)
X	$(CC) -o $@ $(LFLAGS) $(UWTITLE_OBJS) $(LIBUW)
X
Xuwterm:		$(UWTERM_OBJS)
X	$(CC) -o $@ $(LFLAGS) $(UWTERM_OBJS) $(LIBUW)
X
Xuwplot:		$(UWPLOT_OBJS)
X	$(CC) -o $@ $(LFLAGS) $(UWPLOT_OBJS) $(LIBUW)
X
Xlint:
X	for src in $(SOURCES); \
X	do echo $$src:; lint -hubx -I$(INCDIR) $(DEFINES) $$src; done
X
Xtags:
X	ctags $(SOURCES)
X
Xdepend: 
X	$(CC) -M -I$(INCDIR) $(DEFINES) $(SOURCES) | \
X	sed -e ':loop' \
X	    -e 's/\.\.\/[^ /]*\/\.\./../' \
X	    -e 't loop' | \
X	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
X		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
X		       else rec = rec " " $$2 } } \
X	      END { print rec } ' >> makedep
X	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
X	echo '$$r makedep' >>eddep
X	echo 'w' >>eddep
X	cp Makefile Makefile.bak
X	ex - Makefile < eddep
X	rm eddep makedep
X
Xclean:
X	-rm -f *.o
X
X# DO NOT DELETE THIS LINE (or the following blank line) -- make depend uses it
X
END_OF_uw.aux/utility/Makefile_aux
if test 1858 -ne `wc -c <uw.aux/utility/Makefile_aux`; then
    echo shar: \"uw.aux/utility/Makefile_aux\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0

earleh@eleazar.dartmouth.edu (Earle R. Horton) (08/04/88)

In article <15149@apple.Apple.COM> dwb@Apple.COM (David W. Berry) writes:
>What follows is a shar file containing makefiles and a patch
>file for uw 4.2 that allow it to compile and execute under
>A/UX

So far, the only problem I have been able to find is that you might
want to have uwterm execute "remsh" rather than "rsh" under A/UX, as
"rsh" appears to be some sort of restricted shell for second-class
users, and not too useful for remote logins via uwterm.  I have
installed and run uw for a while on an A/UX machine, and it seems to
work fine, including uwterm with the following change:

Earle

: This is a shar archive.  Extract with sh, not csh.
echo x - uwterm.diff
sed -e 's/^X//' > uwterm.diff << '!Funky!Stuff!'
X*** uwterm.c.old	Thu Aug  4 02:24:44 1988
X--- uwterm.c	Thu Aug  4 02:24:57 1988
X***************
X*** 203,209 ****
X--- 203,213 ----
X  	 * Invoke a remote "uwterm" via "rsh".
X  	 */
X  	i = 0;
X+ #ifdef AUX
X+ 	av[i++] = "remsh";
X+ #else   
X  	av[i++] = "rsh";
X+ #endif
X  	av[i++] = host;
X  	av[i++] = "-n";
X  	if (login != NULL) {
!Funky!Stuff!
exit
Mr. Spock!  This disk is damaged!  Do you want to initialize it?

Earle R. Horton.  H.B. 8000, Dartmouth College, Hanover, NH 03755