From: davy@harbor.ecn.purdue.edu (Dave Curry)
Newsgroups: comp.windows.x,comp.unix.solaris,comp.sys.sun.misc
Subject: Solaris 2.0 diffs for MIT X11R5
Date: 27 Aug 92 14:44:21 GMT
Organization: Purdue University Engineering Computer Network


Enclosed are my diffs to the MIT X11R5 sources to make them work under
Solaris 2.0.  I have gotten the clients and libraries to work; the
server compiles but still does not work.  I am using the clients and
libraries with the OpenWindows server, and it seems to work just fine.

Dave Curry
davy@ecn.purdue.edu

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	solaris-x
# This archive created: Thu Aug 27 09:40:51 1992
export PATH; PATH=/bin:$PATH
if test ! -d 'solaris-x'
then
	echo shar: creating directory "'solaris-x'"
	mkdir 'solaris-x'
fi
echo shar: entering directory "'solaris-x'"
cd 'solaris-x'
echo shar: extracting "'NOTES.X11.CLIENTS'" '(2148 characters)'
if test -f 'NOTES.X11.CLIENTS'
then
	echo shar: will not over-write existing file "'NOTES.X11.CLIENTS'"
else
sed 's/^X//' << \SHAR_EOF > 'NOTES.X11.CLIENTS'
XNotes for building MIT X11 Release 5 libraries and clients under Solaris 2.0:
X
X- Change config/sun.cf:
X    - Operating system version:
X	#define OSName		Solaris 2.0/SunOS 5.0
X	#define OSMajorVersion	5
X	#define OSMinorVersion	0
X	#define OSTeenyVersion	0
X    - Shared library support:
X	#if OSMajorVersion > 4
X	#include <sv4Lib.rules>
X	#else
X	#include <sunLib.rules>
X	#endif
X    - Change DefaultCCOptions:
X	#ifdef mc68000
X	#define DefaultCCOptions -f68881 -pipe
X	#else
X	#if OSMajorVersion > 4
X	#define DefaultCCOptions	-Xc -Dsun -Dsparc	
X	#else
X	#define DefaultCCOptions -pipe
X	#endif
X	#endif
X    - Location of C preprocessor:
X    	#if OSMajorVersion > 4
X	#define CppCmd	/usr/ccs/lib/cpp
X	#endif
X    - Other miscellaneous options:
X    	#if OSMajorVersion > 4
X	#define SystemV4		YES
X	#define HasSockets		YES
X	#define BootstrapCFlags		-Dsun -Dsparc
X	#endif
X
X- Change config/site.def (ECN only):
X    - Install location:
X    	#define ProjectRoot	/usr/local/X11R5
X
X- Add to config/imakemdep.h in the appropriate places:
X	#if defined(sun) && defined(SUNOS5)
X	#define imake_ccflags   "-Xc -DSVR4"
X	#endif
X
X	#if defined(sun) && defined(SUNOS5)
X	#define DEFAULT_CPP     "/usr/ccs/lib/cpp"
X	#endif
X
X- Change clients/xinit/xinit.c:
X    - Use fork(), not vfork().  You can't reset signal handlers in vfork()
X      children; it affects the parent.
X
X- Change clients/xmag/xmag.c:
X    - Replace variable name "select" with "zselect" to avoid conflicts.
X
X- Change clients/xterm/main.c, clients/xterm/resize.c, clients/xterm/screen.c:
X    - Change "#ifdef sun" to "#if defined(sun) && !defined(SVR4)" around
X      all the TIOCSWINSZ code.  We want to use TIOCSWINSZ, not TIOCSSIZE.
X
X- Change clients/xterm/main.c and clients/xconsole/xconsole.c:
X    - Change to use the SRIOCSREDIR method of obtaining console output.
X
X- Build with:
X	% make World "BOOTSTRAPCFLAGS=-Dsun -Dsparc -DSUNOS5"
X
X- Make symbolic links:
X    - /usr/local/bin/X11R5 -> /usr/local/X11R5/bin
X    - /usr/local/lib/X11R5 -> /usr/local/X11R5/lib
X    - /usr/local/include/X11R5 -> /usr/local/X11R5/include
X    - for i in /usr/local/X11R5/lib/lib*
X      do
X	  ln -s $i /usr/lib/`basename $i`
X      done
SHAR_EOF
if test 2148 -ne "`wc -c < 'NOTES.X11.CLIENTS'`"
then
	echo shar: error transmitting "'NOTES.X11.CLIENTS'" '(should have been 2148 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'NOTES.X11.SERVER'" '(3566 characters)'
if test -f 'NOTES.X11.SERVER'
then
	echo shar: will not over-write existing file "'NOTES.X11.SERVER'"
else
sed 's/^X//' << \SHAR_EOF > 'NOTES.X11.SERVER'
XNotes for building MIT X11 Release 5 server under Solaris 2.0:
X
X- Make the changes to config/sun.cf, config/site.def, and config/imakemdep.h
X  as described in the libraries and clients note.
X
X- Change fonts/lib/font/util/Imakefile:
X    - Use "ufontutil.[co]" instead of "fontutil.[co]" because of Solaris 2.0
X      bogosity in the loader.
X    - Move fontutil.c in this directory to ufontutil.c for same reason.
X
X- Change server/Imakefile:
X    - "SYSLIBS=-lm -lnisdb /usr/ucblib/libucb.a"
X
X- Change ddx/cfb/stipsparc.s and ddx/cfb/stipsparcte.s:
X    - Subroutine names no longer have an underscore in front of their names.
X
X- Change server/ddx/sun/sun.h:
X    - All #includes of "<sundev/anything.h>" or "<sun/anything.h>" should now
X      be "<sys/anything.h>".
X    - Add #include <unistd.h>.
X    - Add "#define on_exit(a, b) atexit(a)".
X    - Add definition of sigmask() macro.
X
X- Change server/ddx/sun/kbd_mode.c:
X    - All #includes of "<sundev/anything.h>" or "<sun/anything.h>" should now
X      be "<sys/anything.h>".
X    - Add include of <fcntl.h> where O_RDONLY, etc. are now defined.
X
X- Change server/ddx/sun/constype.c:
X    - All #includes of "<sundev/anything.h>" or "<sun/anything.h>" should now
X      be "<sys/anything.h>".
X    - Change <strings.h> to <string.h>.
X    - Add include of <fcntl.h> where O_RDONLY, etc. are now defined.
X
X- Change server/ddx/sunInit.c:
X    - Delete references to "struct sigcontext *scp" around line 105.
X
X- Change server/ddx/sun/sunBW2.c:
X    - All #includes of "<sundev/anything.h>" or "<sun/anything.h>" should now
X      be "<sys/anything.h>".
X
X- Change server/ddx/sun/sunKbd.c:
X    - Add "#define BSD_COMP" before include of <sys/ioctl.h> to get FIONREAD.
X    - Comment out the fcntl(..., F_SETOWN) call; F_SETOWN is gone.
X
X- Change server/ddx/sun/sunMouse.c:
X    - Comment out the fcntl(..., F_SETOWN) call; F_SETOWN is gone.
X
X- Change server/ddx/sun/sunCG.c:
X    - All #includes of "<pixrect/anything.h>" should now be "<sys/anything.h>".
X    - Add contents of SunOS 4.1.1 <struct.h> to top of file.
X
X- Change server/ddx/sun/sunCG2C.c:
X    - All #includes of "<pixrect/anything.h>" should now be "<sys/anything.h>".
X    - Add contents of SunOS 4.1.1 <struct.h> to top of file.
X
X- Change server/ddx/sun/sunCG2M.c:
X    - All #includes of "<pixrect/anything.h>" should now be "<sys/anything.h>".
X    - Add contents of SunOS 4.1.1 <struct.h> to top of file.
X
X- Change server/ddx/sun/sunCG3C.c:
X    - All #includes of "<pixrect/anything.h>" should now be "<sys/anything.h>".
X    - Add contents of SunOS 4.1.1 <struct.h> to top of file.
X
X- Change server/ddx/sun/sunCG4C.c:
X    - All #includes of "<pixrect/anything.h>" should now be "<sys/anything.h>".
X    - All #includes of "<sundev/anything.h>" should now be "<sys/anything.h>".
X    - Add contents of SunOS 4.1.1 <struct.h> to top of file.
X
X- Change server/ddx/sun/sunCG6C.c:
X    - All #includes of "<pixrect/anything.h>" should now be "<sys/anything.h>".
X    - Add contents of SunOS 4.1.1 <struct.h> to top of file.
X    - #ifdef out the call to sunGXInit, since it's distributed object-only.
X
X- Build with:
X	% make World "BOOTSTRAPCFLAGS=-Dsun -Dsparc -DSUNOS5"
X
XThe server now compiles and loads, but it doesn't work.  It dies with the
Xerror
X
X	failed to initialize core devices
X
XAs near as I can tell, this is referring to either the keyboard or the mouse,
Xbut when I try to add printfs, the thing doesn't link anymore.  I think the
Xserver is suffering too much from OS-dependent features, and have little hope
Xthat it'll ever be easy to make it work.  So I've given up.
SHAR_EOF
if test 3566 -ne "`wc -c < 'NOTES.X11.SERVER'`"
then
	echo shar: error transmitting "'NOTES.X11.SERVER'" '(should have been 3566 characters)'
fi
fi # end of overwriting check
if test ! -d 'mit'
then
	echo shar: creating directory "'mit'"
	mkdir 'mit'
fi
echo shar: entering directory "'mit'"
cd 'mit'
if test ! -d 'clients'
then
	echo shar: creating directory "'clients'"
	mkdir 'clients'
fi
echo shar: entering directory "'clients'"
cd 'clients'
if test ! -d 'xinit'
then
	echo shar: creating directory "'xinit'"
	mkdir 'xinit'
fi
echo shar: entering directory "'xinit'"
cd 'xinit'
echo shar: extracting "'xinit.c-diffs'" '(475 characters)'
if test -f 'xinit.c-diffs'
then
	echo shar: will not over-write existing file "'xinit.c-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'xinit.c-diffs'
X*** old/mit/clients/xinit/xinit.c	Mon Aug 17 10:24:05 1992
X--- new/mit/clients/xinit/xinit.c	Tue Aug 25 09:54:49 1992
X***************
X*** 47,52 ****
X--- 47,56 ----
X  #define vfork() fork()
X  #endif /* SYSV and not hpux */
X  
X+ #if defined(sun) && defined(SVR4)
X+ #define vfork()	fork()
X+ #endif /* sun and SVR4 */
X+ 
X  /* A/UX setpgid incorrectly removes the controlling terminal.
X     Per Posix, only setsid should do that. */
X  #if !defined(X_NOT_POSIX) && !defined(macII)
SHAR_EOF
if test 475 -ne "`wc -c < 'xinit.c-diffs'`"
then
	echo shar: error transmitting "'xinit.c-diffs'" '(should have been 475 characters)'
fi
fi # end of overwriting check
echo shar: done with directory "'xinit'"
cd ..
if test ! -d 'xmag'
then
	echo shar: creating directory "'xmag'"
	mkdir 'xmag'
fi
echo shar: entering directory "'xmag'"
cd 'xmag'
echo shar: extracting "'xmag.c-diffs'" '(1519 characters)'
if test -f 'xmag.c-diffs'
then
	echo shar: will not over-write existing file "'xmag.c-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'xmag.c-diffs'
X*** old/mit/clients/xmag/xmag.c	Thu Sep 26 12:32:41 1991
X--- new/mit/clients/xmag/xmag.c	Mon Aug 24 09:20:21 1992
X***************
X*** 888,894 ****
X  
X  
X  
X! static Widget pane1, pane2, pane3, cclose, replace, new, select, paste, label;
X  
X  /*
X   * PopupNewScale() -- Create and popup a new scale composite.
X--- 888,894 ----
X  
X  
X  
X! static Widget pane1, pane2, pane3, cclose, replace, new, zselect, paste, label;
X  
X  /*
X   * PopupNewScale() -- Create and popup a new scale composite.
X***************
X*** 917,925 ****
X    new = XtCreateManagedWidget("new", commandWidgetClass, pane2,
X  			      (Arg *) NULL, 0);
X    XtAddCallback(new, XtNcallback, NewCB, (XtPointer)NULL);
X!   select = XtCreateManagedWidget("select", commandWidgetClass, pane2,
X  			      (Arg *) NULL, 0);
X!   XtAddCallback(select, XtNcallback, SelectCB, (XtPointer)data);
X    paste = XtCreateManagedWidget("paste", commandWidgetClass, pane2,
X  			      (Arg *) NULL, 0);
X    XtAddCallback(paste, XtNcallback, PasteCB, (XtPointer)data);
X--- 917,925 ----
X    new = XtCreateManagedWidget("new", commandWidgetClass, pane2,
X  			      (Arg *) NULL, 0);
X    XtAddCallback(new, XtNcallback, NewCB, (XtPointer)NULL);
X!   zselect = XtCreateManagedWidget("select", commandWidgetClass, pane2,
X  			      (Arg *) NULL, 0);
X!   XtAddCallback(zselect, XtNcallback, SelectCB, (XtPointer)data);
X    paste = XtCreateManagedWidget("paste", commandWidgetClass, pane2,
X  			      (Arg *) NULL, 0);
X    XtAddCallback(paste, XtNcallback, PasteCB, (XtPointer)data);
SHAR_EOF
if test 1519 -ne "`wc -c < 'xmag.c-diffs'`"
then
	echo shar: error transmitting "'xmag.c-diffs'" '(should have been 1519 characters)'
fi
fi # end of overwriting check
echo shar: done with directory "'xmag'"
cd ..
if test ! -d 'xterm'
then
	echo shar: creating directory "'xterm'"
	mkdir 'xterm'
fi
echo shar: entering directory "'xterm'"
cd 'xterm'
echo shar: extracting "'main.c-diffs'" '(4877 characters)'
if test -f 'main.c-diffs'
then
	echo shar: will not over-write existing file "'main.c-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'main.c-diffs'
X*** old/mit/clients/xterm/main.c	Mon Aug 17 10:53:52 1992
X--- new/mit/clients/xterm/main.c	Tue Aug 25 10:23:52 1992
X***************
X*** 56,61 ****
X--- 56,65 ----
X  #include <pwd.h>
X  #include <ctype.h>
X  
X+ #if defined(sun) && defined(SVR4)
X+ #include <sys/strredir.h>
X+ #endif
X+ 
X  #ifdef att
X  #define ATT
X  #endif
X***************
X*** 398,404 ****
X  static int inhibit;
X  static char passedPty[2];	/* name if pty if slave */
X  
X! #ifdef TIOCCONS
X  static int Console;
X  #include <X11/Xmu/SysUtil.h>	/* XmuGetHostname */
X  #define MIT_CONSOLE_LEN	12
X--- 402,408 ----
X  static int inhibit;
X  static char passedPty[2];	/* name if pty if slave */
X  
X! #if defined(TIOCCONS) || defined(SRIOCSREDIR)
X  static int Console;
X  #include <X11/Xmu/SysUtil.h>	/* XmuGetHostname */
X  #define MIT_CONSOLE_LEN	12
X***************
X*** 598,604 ****
X  { "#geom",                 "icon window geometry" },
X  { "-T string",             "title name for window" },
X  { "-n string",             "icon name for window" },
X! #ifdef TIOCCONS
X  { "-C",                    "intercept console messages" },
X  #else
X  { "-C",                    "intercept console messages (not supported)" },
X--- 602,608 ----
X  { "#geom",                 "icon window geometry" },
X  { "-T string",             "title name for window" },
X  { "-n string",             "icon name for window" },
X! #if defined(TIOCCONS) || defined(SRIOCSREDIR)
X  { "-C",                    "intercept console messages" },
X  #else
X  { "-C",                    "intercept console messages (not supported)" },
X***************
X*** 663,669 ****
X      exit (0);
X  }
X  
X! #ifdef TIOCCONS
X  /* ARGSUSED */
X  static Boolean
X  ConvertConsoleSelection(w, selection, target, type, value, length, format)
X--- 667,673 ----
X      exit (0);
X  }
X  
X! #if defined(TIOCCONS) || defined(SRIOCSREDIR)
X  /* ARGSUSED */
X  static Boolean
X  ConvertConsoleSelection(w, selection, target, type, value, length, format)
X***************
X*** 929,935 ****
X  		Help ();
X  		/* NOTREACHED */
X  	     case 'C':
X! #ifdef TIOCCONS
X  		{
X  		    struct stat sbuf;
X  
X--- 933,939 ----
X  		Help ();
X  		/* NOTREACHED */
X  	     case 'C':
X! #if defined(TIOCCONS) || defined(SRIOCSREDIR)
X  		{
X  		    struct stat sbuf;
X  
X***************
X*** 1504,1510 ****
X  	char buf[64];
X  	char *TermName = NULL;
X  	int ldisc = 0;
X! #ifdef sun
X  #ifdef TIOCSSIZE
X  	struct ttysize ts;
X  #endif	/* TIOCSSIZE */
X--- 1508,1514 ----
X  	char buf[64];
X  	char *TermName = NULL;
X  	int ldisc = 0;
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCSSIZE
X  	struct ttysize ts;
X  #endif	/* TIOCSSIZE */
X***************
X*** 1661,1667 ****
X  				       False);
X  	if (!screen->TekEmu)
X  	    VTInit();		/* realize now so know window size for tty driver */
X! #ifdef TIOCCONS
X  	if (Console) {
X  	    /*
X  	     * Inform any running xconsole program
X--- 1665,1671 ----
X  				       False);
X  	if (!screen->TekEmu)
X  	    VTInit();		/* realize now so know window size for tty driver */
X! #if defined(TIOCCONS) || defined(SRIOCSREDIR)
X  	if (Console) {
X  	    /*
X  	     * Inform any running xconsole program
X***************
X*** 1710,1716 ****
X  	    }
X  	}
X  
X! #ifdef sun
X  #ifdef TIOCSSIZE
X  	/* tell tty how big window is */
X  	if(screen->TekEmu) {
X--- 1714,1720 ----
X  	    }
X  	}
X  
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCSSIZE
X  	/* tell tty how big window is */
X  	if(screen->TekEmu) {
X***************
X*** 2084,2089 ****
X--- 2088,2108 ----
X  				    xterm_name);
X  		    }
X  #endif	/* TIOCCONS */
X+ #ifdef SRIOCSREDIR
X+ 		    if (Console) {
X+ 			int consfd;
X+ 			if ((consfd = open("/dev/console", O_RDWR)) < 0) {
X+ 			    fprintf(stderr, "%s: cannot open console\n",
X+ 				    xterm_name);
X+ 			}
X+ 			else {
X+ 			    if (ioctl(consfd, SRIOCSREDIR, tty) < 0) {
X+ 				fprintf(stderr, "%s: cannot redirect console\n",
X+ 					xterm_name);
X+ 			    }
X+ 			}
X+ 		    }
X+ #endif /* SRIOCSREDIR */
X  		}
X  
X  		signal (SIGCHLD, SIG_DFL);
X***************
X*** 2354,2360 ****
X  		    if(handshake.rows > 0 && handshake.cols > 0) {
X  			screen->max_row = handshake.rows;
X  			screen->max_col = handshake.cols;
X! #ifdef sun
X  #ifdef TIOCSSIZE
X  			ts.ts_lines = screen->max_row + 1;
X  			ts.ts_cols = screen->max_col + 1;
X--- 2373,2379 ----
X  		    if(handshake.rows > 0 && handshake.cols > 0) {
X  			screen->max_row = handshake.rows;
X  			screen->max_col = handshake.cols;
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCSSIZE
X  			ts.ts_lines = screen->max_row + 1;
X  			ts.ts_cols = screen->max_col + 1;
X***************
X*** 2410,2416 ****
X  
X  
X  		/* need to reset after all the ioctl bashing we did above */
X! #ifdef sun
X  #ifdef TIOCSSIZE
X  		ioctl  (0, TIOCSSIZE, &ts);
X  #endif	/* TIOCSSIZE */
X--- 2429,2435 ----
X  
X  
X  		/* need to reset after all the ioctl bashing we did above */
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCSSIZE
X  		ioctl  (0, TIOCSSIZE, &ts);
X  #endif	/* TIOCSSIZE */
SHAR_EOF
if test 4877 -ne "`wc -c < 'main.c-diffs'`"
then
	echo shar: error transmitting "'main.c-diffs'" '(should have been 4877 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'resize.c-diffs'" '(1662 characters)'
if test -f 'resize.c-diffs'
then
	echo shar: will not over-write existing file "'resize.c-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'resize.c-diffs'
X*** old/mit/clients/xterm/resize.c	Tue Jul 23 10:12:14 1991
X--- new/mit/clients/xterm/resize.c	Tue Aug 25 09:51:14 1992
X***************
X*** 130,136 ****
X  	"\0337\033[r\033[999;999H\033[6n",
X  	"\033[18t",
X  };
X! #ifndef sun
X  #ifdef TIOCSWINSZ
X  char *getwsize[EMULATIONS] = {	/* size in pixels */
X  	0,
X--- 130,136 ----
X  	"\0337\033[r\033[999;999H\033[6n",
X  	"\033[18t",
X  };
X! #if !defined(sun) || defined(SVR4)
X  #ifdef TIOCSWINSZ
X  char *getwsize[EMULATIONS] = {	/* size in pixels */
X  	0,
X***************
X*** 159,165 ****
X  char sunname[] = "sunsize";
X  int tty;
X  FILE *ttyfp;
X! #ifndef sun
X  #ifdef TIOCSWINSZ
X  char *wsize[EMULATIONS] = {
X  	0,
X--- 159,165 ----
X  char sunname[] = "sunsize";
X  int tty;
X  FILE *ttyfp;
X! #if !defined(sun) || defined(SVR4)
X  #ifdef TIOCSWINSZ
X  char *wsize[EMULATIONS] = {
X  	0,
X***************
X*** 195,201 ****
X  	char newtc [1024];
X  #endif /* USE_TERMCAP */
X  	char buf[BUFSIZ];
X! #ifdef sun
X  #ifdef TIOCSSIZE
X  	struct ttysize ts;
X  #endif	/* TIOCSSIZE */
X--- 195,201 ----
X  	char newtc [1024];
X  #endif /* USE_TERMCAP */
X  	char buf[BUFSIZ];
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCSSIZE
X  	struct ttysize ts;
X  #endif	/* TIOCSSIZE */
X***************
X*** 335,341 ****
X  	}
X  	if(restore[emu])
X  		write(tty, restore[emu], strlen(restore[emu]));
X! #ifdef sun
X  #ifdef TIOCGSIZE
X  	/* finally, set the tty's window size */
X  	if (ioctl (tty, TIOCGSIZE, &ts) != -1) {
X--- 335,341 ----
X  	}
X  	if(restore[emu])
X  		write(tty, restore[emu], strlen(restore[emu]));
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCGSIZE
X  	/* finally, set the tty's window size */
X  	if (ioctl (tty, TIOCGSIZE, &ts) != -1) {
SHAR_EOF
if test 1662 -ne "`wc -c < 'resize.c-diffs'`"
then
	echo shar: error transmitting "'resize.c-diffs'" '(should have been 1662 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'screen.c-diffs'" '(1008 characters)'
if test -f 'screen.c-diffs'
then
	echo shar: will not over-write existing file "'screen.c-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'screen.c-diffs'
X*** old/mit/clients/xterm/screen.c	Thu Aug 22 15:30:38 1991
X--- new/mit/clients/xterm/screen.c	Tue Aug 25 09:07:59 1992
X***************
X*** 485,491 ****
X  	int rows, cols;
X  	int border = 2 * screen->border;
X  	int move_down_by;
X! #ifdef sun
X  #ifdef TIOCSSIZE
X  	struct ttysize ts;
X  #endif	/* TIOCSSIZE */
X--- 485,491 ----
X  	int rows, cols;
X  	int border = 2 * screen->border;
X  	int move_down_by;
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCSSIZE
X  	struct ttysize ts;
X  #endif	/* TIOCSSIZE */
X***************
X*** 579,585 ****
X  	screen->fullVwin.fullheight = height;
X  	screen->fullVwin.fullwidth = width;
X  	ResizeSelection (screen, rows, cols);
X! #ifdef sun
X  #ifdef TIOCSSIZE
X  	/* Set tty's idea of window size */
X  	ts.ts_lines = rows;
X--- 579,585 ----
X  	screen->fullVwin.fullheight = height;
X  	screen->fullVwin.fullwidth = width;
X  	ResizeSelection (screen, rows, cols);
X! #if defined(sun) && !defined(SVR4)
X  #ifdef TIOCSSIZE
X  	/* Set tty's idea of window size */
X  	ts.ts_lines = rows;
SHAR_EOF
if test 1008 -ne "`wc -c < 'screen.c-diffs'`"
then
	echo shar: error transmitting "'screen.c-diffs'" '(should have been 1008 characters)'
fi
fi # end of overwriting check
echo shar: done with directory "'xterm'"
cd ..
if test ! -d 'xconsole'
then
	echo shar: creating directory "'xconsole'"
	mkdir 'xconsole'
fi
echo shar: entering directory "'xconsole'"
cd 'xconsole'
echo shar: extracting "'xconsole.c-diffs'" '(1502 characters)'
if test -f 'xconsole.c-diffs'
then
	echo shar: will not over-write existing file "'xconsole.c-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'xconsole.c-diffs'
X*** old/mit/clients/xconsole/xconsole.c	Thu Jul 25 13:24:34 1991
X--- new/mit/clients/xconsole/xconsole.c	Tue Aug 25 10:32:58 1992
X***************
X*** 46,51 ****
X--- 46,55 ----
X  #include <stdio.h>
X  #include <ctype.h>
X  
X+ #if defined(sun) && defined(SVR4)
X+ #include <sys/strredir.h>
X+ #endif
X+ 
X  /* Fix ISC brain damage.  When using gcc fdopen isn't declared in <stdio.h>. */
X  #if defined(SYSV) && defined(SYSV386) && defined(__STDC__) && defined(ISC)
X  extern FILE *fdopen(int, char const *);
X***************
X*** 117,123 ****
X  #include    <sys/stropts.h>		/* for I_PUSH */
X  #endif
X  
X! #ifdef TIOCCONS
X  #define USE_PTY
X  static int  tty_fd, pty_fd;
X  static char ttydev[64], ptydev[64];
X--- 121,127 ----
X  #include    <sys/stropts.h>		/* for I_PUSH */
X  #endif
X  
X! #if defined(TIOCCONS) || defined(SRIOCSREDIR)
X  #define USE_PTY
X  static int  tty_fd, pty_fd;
X  static char ttydev[64], ptydev[64];
X***************
X*** 150,160 ****
X--- 154,176 ----
X  #ifdef USE_PTY
X  		int	on = 1;
X  
X+ #ifdef TIOCCONS
X  		if (get_pty (&pty_fd, &tty_fd, ttydev, ptydev) == 0 &&
X  		    ioctl (tty_fd, TIOCCONS, (char *) &on) != -1)
X  		{
X  		    input = fdopen (pty_fd, "r");
X  		}
X+ #endif
X+ #ifdef SRIOCSREDIR
X+ 		if (get_pty (&pty_fd, &tty_fd, ttydev, ptydev) == 0) {
X+ 		    int consfd;
X+ 		    if ((consfd = open("/dev/console", O_RDWR)) != -1 &&
X+ 		        ioctl(consfd, SRIOCSREDIR, tty_fd) != -1)
X+ 		    {
X+ 			input = fdopen (pty_fd, "r");
X+ 		    }
X+ 		}
X+ #endif
X  #endif
X  	    }
X  #ifdef USE_OSM
SHAR_EOF
if test 1502 -ne "`wc -c < 'xconsole.c-diffs'`"
then
	echo shar: error transmitting "'xconsole.c-diffs'" '(should have been 1502 characters)'
fi
fi # end of overwriting check
echo shar: done with directory "'xconsole'"
cd ..
echo shar: done with directory "'clients'"
cd ..
if test ! -d 'config'
then
	echo shar: creating directory "'config'"
	mkdir 'config'
fi
echo shar: entering directory "'config'"
cd 'config'
echo shar: extracting "'sun.cf-diffs'" '(1864 characters)'
if test -f 'sun.cf-diffs'
then
	echo shar: will not over-write existing file "'sun.cf-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'sun.cf-diffs'
X*** old/mit/config/sun.cf	Mon Aug 17 10:52:38 1992
X--- new/mit/config/sun.cf	Fri Aug 21 10:01:08 1992
X***************
X*** 1,10 ****
X  XCOMM platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
X  
X! #define OSName            SunOS 4.1.1
X  XCOMM operating system:  OSName
X! #define OSMajorVersion    4
X! #define OSMinorVersion    1
X! #define OSTeenyVersion    1
X  
X  #if OSMajorVersion < 4 || (OSMajorVersion == 4 && OSMinorVersion < 1)
X  /* We do not guarantee this will work */
X--- 1,10 ----
X  XCOMM platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
X  
X! #define OSName            Solaris 2.0/SunOS 5.0
X  XCOMM operating system:  OSName
X! #define OSMajorVersion    5
X! #define OSMinorVersion    0
X! #define OSTeenyVersion    0
X  
X  #if OSMajorVersion < 4 || (OSMajorVersion == 4 && OSMinorVersion < 1)
X  /* We do not guarantee this will work */
X***************
X*** 17,22 ****
X--- 17,32 ----
X  #define SunPost411FCSLd	  YES
X  #endif
X  
X+ #if OSMajorVersion > 4
X+ #define CppCmd		/usr/ccs/lib/cpp
X+ #endif
X+ 
X+ #if OSMajorVersion > 4
X+ #define SystemV4	  YES
X+ #define HasSockets	  YES
X+ #define BootstrapCFLags	  -Dsun -Dsparc
X+ #endif
X+ 
X  #define HasSaberC	  YES
X  #define HasNdbm		  YES
X  #define HasShm		  YES
X***************
X*** 37,43 ****
X--- 47,57 ----
X  #define i386Architecture
X  #endif
X  
X+ #if OSMajorVersion > 4
X+ #include <sv4Lib.rules>
X+ #else
X  #include <sunLib.rules>
X+ #endif
X  
X  #if HasGcc
X  
X***************
X*** 55,62 ****
X--- 69,80 ----
X  #ifdef mc68000
X  #define DefaultCCOptions -f68881 -pipe
X  #else
X+ #if OSMajorVersion > 4
X+ #define DefaultCCOptions  -Xc -Dsun -Dsparc
X+ #else
X  #define DefaultCCOptions -pipe
X  #endif
X+ #endif
X  
X  #define PexCCOptions DefaultCCOptions
X  
X***************
X*** 76,78 ****
X--- 94,97 ----
X  #endif
X  
X  #define ServerOSDefines SunWindowsDefines AllocateLocalDefines
X+ 
SHAR_EOF
if test 1864 -ne "`wc -c < 'sun.cf-diffs'`"
then
	echo shar: error transmitting "'sun.cf-diffs'" '(should have been 1864 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'imakemdep.h-diffs'" '(681 characters)'
if test -f 'imakemdep.h-diffs'
then
	echo shar: will not over-write existing file "'imakemdep.h-diffs'"
else
sed 's/^X//' << \SHAR_EOF > 'imakemdep.h-diffs'
X*** old/mit/config/imakemdep.h	Sun Aug 25 14:39:59 1991
X--- new/mit/config/imakemdep.h	Fri Aug 21 10:13:57 1992
X***************
X*** 46,51 ****
X--- 46,55 ----
X  #endif
X  #endif
X  
X+ #if defined(sun) && defined(SUNOS5)
X+ #define imake_ccflags	"-Xc -DSVR4"
X+ #endif
X+ 
X  #ifdef CRAY
X  /* -DX_NOT_STDC_ENV is just so we can bootstrap with cc instead of scc */
X  #define imake_ccflags "-DSYSV -DUSG -DX_NOT_STDC_ENV"
X***************
X*** 125,130 ****
X--- 129,137 ----
X  #endif
X  #if defined(_IBMR2) && !defined(DEFAULT_CPP)
X  #define DEFAULT_CPP "/usr/lpp/X11/Xamples/util/cpp/cpp"
X+ #endif
X+ #if defined(sun) && defined(SUNOS5)
X+ #define DEFAULT_CPP "/usr/ccs/lib/cpp"
X  #endif
X  
X  /*
SHAR_EOF
if test 681 -ne "`wc -c < 'imakemdep.h-diffs'`"
then
	echo shar: error transmitting "'imakemdep.h-diffs'" '(should have been 681 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'sun.cf'" '(2206 characters)'
if test -f 'sun.cf'
then
	echo shar: will not over-write existing file "'sun.cf'"
else
sed 's/^X//' << \SHAR_EOF > 'sun.cf'
XXCOMM platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
X
X#define OSName            Solaris 2.0/SunOS 5.0
XXCOMM operating system:  OSName
X#define OSMajorVersion    5
X#define OSMinorVersion    0
X#define OSTeenyVersion    0
X
X#if OSMajorVersion < 4 || (OSMajorVersion == 4 && OSMinorVersion < 1)
X/* We do not guarantee this will work */
X#define BootstrapCFlags   -DNOSTDHDRS
X#define StandardDefines   -DNOSTDHDRS
X#endif
X
X/* You ALSO need this if you have Sun ld patch 100170-06 or later to 4.1.1 */
X#if OSMajorVersion == 4 && (OSMinorVersion > 1 || (OSMinorVersion == 1 && OSTeenyVersion > 1))
X#define SunPost411FCSLd	  YES
X#endif
X
X#if OSMajorVersion > 4
X#define CppCmd		/usr/ccs/lib/cpp
X#endif
X
X#if OSMajorVersion > 4
X#define SystemV4	  YES
X#define HasSockets	  YES
X#define BootstrapCFLags	  -Dsun -Dsparc
X#endif
X
X#define HasSaberC	  YES
X#define HasNdbm		  YES
X#define HasShm		  YES
X#define HasSecureRPC	  YES
X#define SetTtyGroup	  YES
X#define HasPutenv	  YES
X#define XsunServer	  YES		/* has color and mono support */
X#define XsunMonoServer	  YES		/* monochrome only */
X#define BuildPexExt	  XsunServer
X#define InstKmemFlags	  -g kmem -m 2755
X
X#ifdef sparc
X#undef sparc
X#define SparcArchitecture
X#endif
X#ifdef sun386
X#undef sun386
X#define i386Architecture
X#endif
X
X#if OSMajorVersion > 4
X#include <sv4Lib.rules>
X#else
X#include <sunLib.rules>
X#endif
X
X#if HasGcc
X
X#define SharedLibraryCcCmd cc
X#define ExtraLoadFlags -B/usr/bin/
X#define AllocateLocalDefines /**/
X
X.c.o:
X	$(CC) -c $(CFLAGS) $*.c
X
X#else
X
X#define AllocateLocalDefines -DINCLUDE_ALLOCA_H
X
X#ifdef mc68000
X#define DefaultCCOptions -f68881 -pipe
X#else
X#if OSMajorVersion > 4
X#define DefaultCCOptions  -Xc -Dsun -Dsparc
X#else
X#define DefaultCCOptions -pipe
X#endif
X#endif
X
X#define PexCCOptions DefaultCCOptions
X
X#endif
X
X#define SharedAllocateLocalDefines -DINCLUDE_ALLOCA_H
X#define LibraryCCOptions /* don't want special floating point */
X
X#ifndef UseSunWindowsInServer
X#define UseSunWindowsInServer	NO	/* link in SunWindows support? */
X#endif
X
X#if UseSunWindowsInServer
X#define SunWindowsDefines -DSUN_WINDOWS
X#else
X#define SunWindowsDefines /* as nothing */
X#endif
X
X#define ServerOSDefines SunWindowsDefines AllocateLocalDefines
X
SHAR_EOF
if test 2206 -ne "`wc -c < 'sun.cf'`"
then
	echo shar: error transmitting "'sun.cf'" '(should have been 2206 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'site.def'" '(2406 characters)'
if test -f 'site.def'
then
	echo shar: will not over-write existing file "'site.def'"
else
sed 's/^X//' << \SHAR_EOF > 'site.def'
XXCOMM site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
X
X/*****************************************************************************
X *                                                                           *
X *			   SITE-SPECIFIC DEFINITIONS                         *
X *                                                                           *
X * This file contains two halves, one included before the vendor-specific    *
X * configuration file (.cf file), and one included after the .cf file.       *
X * The before-half should be protected by #ifdef BeforeVendorCF, and the     *
X * after-half should be protected by #ifdef AfterVendorCF.                   *
X *                                                                           *
X * The before-half should only set things that the .cf file depends on.      *
X * For the .cf files shipped in this release, the main variable in this      *
X * category is HasGcc.                                                       *
X *                                                                           *
X * The after-half should contain all other definitions.  For example,        *
X * place your ProjectRoot definition here.  Beware that several of the       *
X * .cf files supplied by vendors have a ProjectRoot already defined, so      *
X * you may need to #undef it first.                                          *
X *                                                                           *
X * OS Major and Minor version numbers should be changed directly in the .cf  *
X * file, not overridden in site.def.                                         *
X *                                                                           *
X *****************************************************************************/
X
X#ifdef BeforeVendorCF
X
X/* #define HasGcc YES */
X
X#endif /* BeforeVendorCF */
X
X#ifdef AfterVendorCF
X
X#ifdef ProjectRoot
X#undef ProjectRoot
X#endif
X#define ProjectRoot	/usr/local/X11R5
X
X#ifdef InstallFSConfig
X#undef InstallFSConfig
X#endif InstallFSConfig
X#define InstallFSConfig YES
X
X#ifdef MotifBC
X#undef MotifBC
X#endif MotifBC
X#define MotifBC YES
X
X#if defined(SunArchitecture)&& defined(mc68000)
X#undef LibraryCCOptions
X#define SharedLibraryCCOptions -f68881 -pipe
X#endif
X
X/*
X * We DON'T want SecureRPC!
X */
X#undef HasSecureRPC
X#define HasSecureRPC      NO
X
X#define SunPost411FCSLd   NO
X
X#endif /* AfterVendorCF */
SHAR_EOF
if test 2406 -ne "`wc -c < 'site.def'`"
then
	echo shar: error transmitting "'site.def'" '(should have been 2406 characters)'
fi
fi # end of overwriting check
echo shar: done with directory "'config'"
cd ..
echo shar: done with directory "'mit'"
cd ..
echo shar: extracting "'README'" '(6122 characters)'
if test -f 'README'
then
	echo shar: will not over-write existing file "'README'"
else
sed 's/^X//' << \SHAR_EOF > 'README'
X
XContained in this shar file are my diffs to the MIT X11R5 sources to make
Xthem compile and run under Solaris 2.0/SunOS 5.0.  Kudos go to the MIT X
Xfolks for making this stuff as portable as it is; with the exception of the
Xserver, everything was really simple.
X
XThe files contained in this shar file are:
X
X  NOTES.X11.CLIENTS
X    My notes as I was doing things; this explains what files I changed and
X    why.  The diffs for the files described here are included in this shar
X    file.
X
X  NOTES.X11.SERVER
X    My notes as I was doing things trying to make the server work; it
X    explains what files I changed and why.  I have not included the diffs
X    for these files; they're mostly minor, and since the server still
X    doesn't work, they aren't too useful.
X
X  mit/config/sun.cf-diffs
X    Diffs to the "sun.cf" configuration file for Solaris 2.0.
X
X  mit/config/sun.cf
X    A copy of the "sun.cf" configuration file I used to build the release.
X
X  mit/config/site.def
X    A copy of our "site.def" file, for reference.
X
X  mit/config/imakemdep.h-diffs
X    Diffs to "imakemdep.h" to get imake to compile and work properly (mostly
X    it's to define a few things, and note the new location of the C
X    preprocessor).
X
X  mit/clients/xconsole/xconsole.c-diffs
X  mit/clients/xinit/xinit.c-diffs
X  mit/clients/xmag/xmag.c-diffs
X  mit/clients/xterm/main.c-diffs
X  mit/clients/xterm/resize.c-diffs
X  mit/clients/xterm/screen.c-diffs
X    Diffs to various pieces of clients that are needed to make them work
X    properly under Solaris 2.0.  The diffs to xmag make it compile, the
X    diffs to xinit keep it from dumping core, the diffs to xconsole and
X    xterm make them work for grabbing the console, and make window sizes
X    work under xterm.
X
XI have gotten the libraries and MIT clients to work; the server compiles and
Xloads, but does not work.  I do not plan to continue work on the server; I
Xam currently using the OpenWindows 3.0.1 server with these MIT X11R5 clients
Xand libraries, and this works satisfactorily.  See the file NOTES.X11.SERVER
Xif you want some starting points for how to make it compile; maybe you can
Xfigure out what's wrong with it.
X
XI used the SunPro C compiler and tools when doing this.  I don't know if GCC
Xwill work with these patches (and I don't care, either :-).
X
XEverything was compiled using the "-Xc" (strict ANSI C) option to the
Xcompiler.  Because under "-Xc" there are no pre-defined symbols, you have to
Xset things up to pass "-Dsun" through; I also put in "-Dsparc" for good
Xmeasure, although it probably wasn't necessary.  By defining "SystemV4" in
Xthe "sun.cf" file, imake will also give you "-DSVR4".  I usually used
Xsomething along the lines of "#if defined(sun) && defined(SVR4)" when
Xmaking Solaris 2.0-specific changes.
X
XSince Solaris 2.0/SunOS 5.0 is System V Release 4, changing the shared
Xlibrary rules from the Sun rules to the SVR4 rules (provided with X11R5)
Xsolves the problem of getting shared libraries.  There is one problem -- the
Xrun-time loader no longer searches /usr/local/lib; it only searches
X/usr/lib.  So, if you install the X11R5 libraries in /usr/local or someplace
Xother than /usr/lib, you need to make symbolic links from /usr/lib to the
Xlibraries to get things like xterm to work (since LD_LIBRARY_PATH is not
Xeffective for setuid programs).  It may be possible to get around this by
Xusing the "-R" option to the loader, but I have not tried it.
X
XAfter applying the diffs, when you run "make World", you should give
XBOOTSTRAPCFLAGS as:
X
X	% make World "BOOTSTRAPCFLAGS=-Xc -Dsun -Dsparc -DSUNOS5"
X
XAnyway, I got the entire contents of the "mit" tree to compile, and as far
Xas I know, the server is the only thing that does not work.  You may want to
Xjust not bother even building the server; this will certainly save you
Xconsiderable time, and will save disk space by not installing all the fonts,
Xetc.  I have actually used and tested the following clients:
X
X	bitmap			xhost
X	constype		xinit
X	imake			xlsfonts
X	mkdirhier		xmkmf
X	mkfontdir		xrdb
X	xbiff			xset
X	xclock			xterm
X	xconsole		xwininfo
X	xeyes
X
XIn addition, I have built the following clients that are not "mit" clients.
XI have not included diffs for these, and don't plan to make them available,
Xsince in some cases, I did not save the original versison of the sources.
XAll the changes are realtively minor, and are all straightforward.
X
X	ghostscript 2.5		- builds and runs, no problems
X	ghostview 1.3		- builds and runs, no problems
X	xfig 2.1.4		- builds and runs, no problems
X	xlock			- had to build in Berkeley source compat
X				  mode (/usr/ucb/cc), works fine
X	xmessage		- builds and runs, no problems
X	xpostit			- builds and runs, no problems
X	xpipeman		- builds and runs, no problems
X	xrn 6.17		- takes some changes for timezone and stuff,
X				  pretty easy, works fine
X	xtetris			- builds and runs, no problems
X	xtroff			- builds and runs, no problems
X	xv 2.2			- had to build in Berkeley source compat
X				  mode (/usr/ucb/cc), works fine
X
XThe most annying thing about building the clients is that everyone uses
X"static char" to hold bitmaps, instead of "static unsigned char".  The
XSunPro C compiler prints a warning message for every single character in a
Xbitmap that has the eighth bit set!  (This is truly stupid, I agree, but
Xthey do it.)  It's usually easier to edit all the bitmaps and change them to
Xunsigned chars, rather than watch all the warning messages.  Yeeesh.  The
Xother recurring problem was the usual BSD->SysV problem of converting
Xbcopy/bzero/bcmp to memcpy/memset/memcmp.
X
XAnyway, this should be enough to get you most of the way to having X11R5 on
XSolaris 2.0.  If anyone figures out how to make the server work, I'd really
Xlike to hear about it.  I don't have the motivation to do it, for three
Xreasons: (1) X11R6 is supposedly coming out Real Soon Now, and I'm hoping it
Xwill support Solaris 2.0, (2) supposedly the next release of OpenWindows
Xwill have NeWS ripped out of the server, and (3) the current OpenWindows
Xserver runs just fine with the R5 clients and libraries.
X
XEnjoy,
X
XDave Curry
XPurdue University
XEngineering Computer Network
Xdavy@ecn.purdue.edu
SHAR_EOF
if test 6122 -ne "`wc -c < 'README'`"
then
	echo shar: error transmitting "'README'" '(should have been 6122 characters)'
fi
fi # end of overwriting check
echo shar: done with directory "'solaris-x'"
cd ..
#	End of shell archive
exit 0
Newsgroups: comp.windows.x