From: db@sunbim.be
Subject: X11r5 patches for Solaris 2.0 !
Organization: The Internet
Date: Tue, 28 Jul 1992 13:04:43 GMT


This is my first attempt to get X11r5 to work on Solaris 2.0.

You will find the patches I applied to my sources in order to do this
below.

Note several things however :
	- this is an incompletely tested port.
	- this is an incomplete port (see Notes: below), because of
		some problems.
	- I am still running the Solaris 2.0 Early Access (Feb. 1992)
		I suppose Sun sends out the CD's to the US first :-(

Some more positive signs :
	- most X clients seem to work. (except bitmap, xcalc)
	- OSF/Motif 1.2 seems to work well on top of it.
	- if you already have Solaris 2.0 FCS, then you may not
	  suffer from the problems I currently have.

I suppose the X Consortium will soon come out with an "official" patch
for Solaris 2.0. My patches may help you get started in the mean time.
Don't throw away this patch file if you use it. You will want to back
out my changes when the Consortium releases its official patch.

Finally, suggestions for improvement are welcomed.

	Danny Backx				db@sunbim.be
	System Engineer, BIM, Kwikstraat 4, B-3078 Everberg, Belgium
	Tel. +32(2)759.59.25			Fax. +32(2)759.47.95


Notes :
	- Compilation must be done with BOOTSTRAPCFLAGS=-DSVR4

	- I have used the Sun Unbundled C compiler for my work.
	  I had the Cygnus development system as well, but didn't use
	  it. There are a few changes for the Cygnus system in sun.cf,
	  but they are probably incomplete.

	- for the Imakefile changes (LEX and YACC), I am depending
	  on the fact that the default rules for make have the
	  following definitions :
		LEX=lex
		YACC=yacc
	  because I've e.g. changed "yacc" to "${YACC}" several
	  times.

	- sockets vs. TLI - there are a couple of places where there
	  is something of TLI, but incomplete. E.g. XDM still has
	  a call to accept() if you compile with -DSTREAMSCONN.
	  I have therefore decided not currently to do anything about
	  that.

	- Because of not currently getting rid of sockets etc., it
	  really makes no sense to try to get rid of libucb either.
	  Therefore, the BSD compatibility package must be installed
	  for all this to work.

	- for all this to work, you better have
		/opt/SUNWste/bin
	  in your path, and better before /usr/css/bin.
	  If you're using Cygnus' development package, you should
	  have /opt/cygnus-sol2/bin in your path.

	- (This applies to the Sun C compiler.) It is a good idea to
		setenv TMPDIR /tmp
	  which is a SWAP tmp by default, and therefore is bigger
	  than /var/tmp which the C compiler uses.

	- Some stuff didn't compile on my system. The reason is (I think)
	  a bug in the LD for Solaris 2.0 beta. When compiling certain
	  apps with $MIT/fonts/lib/font/libfont.a, ld seemed to go in an
	  infinite loop. Obviously it didn't create any executable image.
	  The message it kept spitting at me all the time was

	cc -O -Xc -o fs  difs/libdifs.a ../.././fonts/lib/font/libfont.a difs/libdifs.a os/libos.a    
	ld: warning: file ../.././fonts/lib/font/libfont.a(fsfuncs.o): attempted multiple inclusion of file 
	ld: warning: file ../.././fonts/lib/font/libfont.a(fsfuncs.o): attempted multiple inclusion of file 
	ld: warning: file ../.././fonts/lib/font/libfont.a(fsfuncs.o): attempted multiple inclusion of file 


	  Applications that didn't make it because of this :
		server/Xsun
		fonts/server/fs
		fonts/clients/mkfontdir

	  Because of the fact that I couldn't compile a server, all of PEX
	  is untested.

	  For another reason, xcalc didn't compile on my system.
	  Description below.

	- clients/bitmap/bitmap doesn't seem to work.
		aretha!db 467 % bitmap
		Error: Unresolved inheritance operation

clients/twm/Makefile :
	Yacc and lex - don't seem to exist under Solaris 2.0
	Therefore, fell back to the Cygnus development package...
		YACC=	byacc
		LEX=	flex
	Changes to both clients/twm/Imakefile and config/sun.cf to
	make LEX and YACC work.

clients/twm/lex.l :
	Definition of yywrap() is not needed - #ifdeffed it out.
		#ifndef yywrap
		yywrap() {return(1);}
		#endif

	This may be a Cygnus-only problem.

clients/xcalc/math.c :
	In SVR4, xcalc tries to use FPE_INTDIV etc. which are documented
	in siginfo(5) as supposed to be known macros if you
		#include <siginfo.h>
	There seems to be no header file which has these symbols in them...
	Note that I'm still running the "Early Access" (February 1992)
	version of Solaris 2.0.

clients/xload/get_load.c :
	Kernel file is not "/stand/unix" but "/kernel/unix".

clients/xload/Imakefile :
	Need nlist(3E), and therefore must link with "-L/usr/ucblib -lucb".
	Added this in the Imakefile.

clients/xdm/Imakefile :
	socket stuff needs -lsocket

demos/xgc/Imakefile :
	needs LEX and YACC.

config/sun.cf :
	Added an attempt to support the Cygnus environment.
	LEX and YACC variables.

	Do we have to use -DTCPCONN -DUNIXCONN -DSTREAMSCONN ?
		Currently didn't use STREAMSCONN because the
		R5 Release Notes say you're in trouble if you
		don't have sockets.

	#define SystemV4 makes a lot of things work - most
		-lnsl are ok after that.

	I edited it to always have -lsocket together with -lnsl


fonts/clients/fsinfo/Imakefile, fonts/clients/fslsfonts/Imakefile,
fonts/clients/fstobdf/Imakefile, fonts/clients/showfont/Imakefile :
	needed -lsocket -lnsl

clients/xterm/main.c, clients/xterm/resize.c :
	All places where "#ifdef sun" was found were changed to
		#if defined(sun) && !defined(SVR4)

	Also, a couple of lines were added to resize.c to make it
	print something under SVR4 as well. Probably not necessary.

clients/xconsole/xconsole.c :
	Added support for wscons(7). Also had to fix the fact that TIOCCONS
	was still #defined in /usr/include/sys/suntty.h, but not working.

	Xconsole needs to be setuid to root to work under SVR4.

clients/xconsole/Imakefile, clients/xterm/Imakefile, clients/xload/Imakefile :
	All setuid-something programs need to be compiled with LD_RUN_PATH
	set when doing the final link. If not, they will not pick up the
	libraries from (e.g.) /usr/ucblib because that directory is not
	secure.

	Note - these patches do NOT implement LD_RUN_PATH. You should recompile
	these three clients yourself after the global build, with LD_RUN_PATH
	set.

server/ddx/sun/Imakefile :
	Had to make the GX stuff not happen on Solaris 2.0. Don't have the
	driver yet...

server/ddx/sun/sun.h, server/ddx/sun/*.c :
	Changed all #include <sundev/.. or <sun/... to <sys/
	Same thing for <pixrect/...
	Also had to remove all #include <struct.h>
	Added #include <unistd.h> for R_OK and X_OK.

server/ddx/sun/kbd_mode.c, server/ddx/sun/constype.c :
	Similar changes.



===========
Two articles previouly posted about porting X11r5 to ATT SVr4 -

> Article 32286 of comp.windows.x:
> From: steve@ecf.toronto.edu (Steve Kotsopoulos)
> Newsgroups: comp.windows.x,comp.unix.sysv386
> Subject: Building X11R5 under AT&T SVR4
> Message-ID: <1991Sep12.164818.16380@ecf.toronto.edu>
> Date: 12 Sep 91 16:48:18 GMT
> Organization: University of Toronto, Engineering Computing Facility
> Lines: 56
>
> Now that I have the server and clients working, here is a list of
> things people should check if they are having problems building X11R5
> (I run AT&T's SVR4, so I'm not sure how much of this applies
> to DELL, ESIX, ISC or SCO)  :-(
>
> 1. You will need lots of disk space! I repartitioned my disk so that
>    I had a 250Meg /X11 area for source and installed binaries.
>    As it turns out, I didn't need that much, but I will probably use
>    it all up once the contrib stuff is released.
>
> 2. I had lots of problems trying to use gcc, so I used the standard
>    C compiler. Make sure that you don't have /usr/ucb before /bin
>    in your path, or else you will get a shell script version of cc
>    that set a bunch of parameters (incorrectly, for X11R5) before
>    calling /usr/ccs/bin/cc to do the real work.
>
> 3. Follow the advice of Steve Hite (shite@sinkhole.unf.edu):
>      "DON'T use the C shell on Esix 4.0.3a.  The X library is HUGE and
>       csh complains about too long of an argument list.  The Korn shell
>       will work just dandy."
>
>    All my clients were dumping core at first, but after changing to the
>    Korn shell (and also changing several other things at the same time,
>    so I'm not sure if csh was the culprit) they all worked properly. 
>
>    Note: I did not get any complaints about too long of an argument
> 	 list, so maybe this is only neccessary on Esix.
>
> 4. Change the line in server/Imakefile that reads:
>         SYSLIBS = -lm /usr/ucblib/libucb.a
>    to read:
>         SYSLIBS = -lm -lc /usr/ucblib/libucb.a
>
>    This ensures that the directory reading routines from libc.a are
>    used intead of the ones in libucb.a (BSD version of readdir).
>
> 5. Go for it, with: make World BOOTSTRAPCFLAGS="-DATT -DSVR4 -DSYSV386"
>    This took 3.5 hours on a 33MHz 486.
>
> 6. fix the 2 suid clients (xterm & xload):
> 	'export LD_RUN_PATH=/usr/X386/lib'
> 	delete mit/clients/xterm/xterm & mit/clients/xload/xload and
> 	relink them again.
>
> 7. make install
>
> If anyone has problems with the X386 server you should be aware that
> MIT was not able to test it because they do not have a SVGA board.
>
> Also, MANY thanks to mark@zok.sgcs.com and roell@dell.com for all the
> work they put into getting X386 included in X11R5.
> -- 
> Steve Kotsopoulos                   mail:   steve@ecf.toronto.edu
> Systems Analyst                     bitnet: steve@ecf.UTORONTO.BITNET
> Engineering Computing Facility      uucp:   uunet!utai!ecf!steve
> University of Toronto               phone:  (416) 978-5898


> Article 32398 of comp.windows.x:
> From: mats@alruna.UUCP (Mats Wichmann)
> Newsgroups: comp.windows.x
> Subject: Re: Building X11R5 under AT&T SVR4
> Message-ID: <24624.9109131444@unisoft.unisoft.com>
> Date: 13 Sep 91 14:43:10 GMT
> Sender: daemon@athena.mit.edu (Mr Background)
> Organization: The Internet
> Lines: 37
>
> On Sep 12,  4:48pm, Steve Kotsopoulos wrote:
> ] Now that I have the server and clients working, here is a list of
> ] things people should check if they are having problems building X11R5
> ] (I run AT&T's SVR4, so I'm not sure how much of this applies
> ] to DELL, ESIX, ISC or SCO)  :-(
> ] 
> ....
> This one for sure applies to all sVr4's:
> ] 
> ] 4. Change the line in server/Imakefile that reads:
> ]         SYSLIBS = -lm /usr/ucblib/libucb.a
> ]    to read:
> ]         SYSLIBS = -lm -lc /usr/ucblib/libucb.a
> ] 
> ]    This ensures that the directory reading routines from libc.a are
> ]    used intead of the ones in libucb.a (BSD version of readdir).
>
> I haven't seen the x11r5 source yet (still waiting, sigh), but this is a
> problem I've run into many a time in the nine months or so I've been running
> sVr4:  while the ucblib does provide some useful utility, it has a tendency
> to supply routines you don't expect, so unless you are explicitly trying to
> get a BSD-ish program to work without porting (hint: odds are good you won't
> get away with it anyway), you'll need -lc before -lucb to insure you get
> sVr4's "standard" libc versions of things.  The readdir routines are just
> one of many instances of this.  You'll probably also need to make sure that
> -I/usr/include precededs -I/usr/ucbinclude.
>
> For things that use Larry Wall's Shell Script From Hell (Configure), it
> might sometimes even be necessary to take /usr/ucb out of your path before
> running it - or it will go find things in /usr/ucb that you don't want
> it to use!!!
>
>
> -- 
> Mats Wichmann
> Systems Software Consultant
> alruna!mats@unisoft.com


Patches...

Note that I haven't included a patch file for config/sun.cf because the sun.cf
that I started from was already hacked up.
You will find my complete config/sun.cf file at the end, as a shar file.


*** mit/extensions/lib/PEX/cp/Imakefile.orig	Tue Jul 23 03:09:49 1991
--- mit/extensions/lib/PEX/cp/Imakefile	Fri Jul 24 09:58:19 1992
***************
*** 29,34 ****
--- 29,38 ----
  #define PexPhigsCDebugFlags LibraryCDebugFlags
  #endif
  
+ #if defined(SunArchitecture) && defined(SVR4)
+ SYS_LIBRARIES = -lsocket
+ #endif
+ 
    CCOPTIONS = PexCCOptions
  CDEBUGFLAGS = PexPhigsCDebugFlags
      DEFINES = PexPhigsDefines
*** mit/fonts/clients/fsinfo/Imakefile.orig	Wed Jul 17 20:04:42 1991
--- mit/fonts/clients/fsinfo/Imakefile	Fri Jul 24 11:27:59 1992
***************
*** 5,9 ****
--- 5,13 ----
  OBJS = fsinfo.o
  INCLUDES = -I$(FONTSRC)/include
  
+ #if defined(SunArchitecture) && defined(SVR4)
+ SYS_LIBRARIES = -lsocket -lnsl
+ #endif
+ 
  ComplexProgramTarget(fsinfo)
  
*** mit/fonts/clients/fslsfonts/Imakefile.orig	Wed Jul 17 20:04:49 1991
--- mit/fonts/clients/fslsfonts/Imakefile	Fri Jul 24 11:29:36 1992
***************
*** 5,9 ****
--- 5,13 ----
  OBJS = fslsfonts.o
  INCLUDES = -I$(FONTSRC)/include
  
+ #if defined(SunArchitecture) && defined(SVR4)
+ SYS_LIBRARIES = -lsocket -lnsl
+ #endif
+ 
  ComplexProgramTarget(fslsfonts)
  
*** mit/fonts/clients/fstobdf/Imakefile.orig	Wed Jul 17 20:04:55 1991
--- mit/fonts/clients/fstobdf/Imakefile	Fri Jul 24 11:30:31 1992
***************
*** 3,8 ****
--- 3,12 ----
  DEPLIBS = $(FSLIBSRC)/libFS.a $(DEPXLIB)
  INCLUDES = -I$(FONTSRC)/include
  
+ #if defined(SunArchitecture) && defined(SVR4)
+ SYS_LIBRARIES = -lsocket -lnsl
+ #endif
+ 
             SRCS = chars.c fstobdf.c header.c props.c
             OBJS = chars.o fstobdf.o header.o props.o
  
*** mit/fonts/clients/showfont/Imakefile.orig	Wed Jul 17 20:05:00 1991
--- mit/fonts/clients/showfont/Imakefile	Fri Jul 24 11:32:40 1992
***************
*** 5,9 ****
--- 5,13 ----
  OBJS = showfont.o
  INCLUDES = -I$(FONTSRC)/include
  
+ #if defined(SunArchitecture) && defined(SVR4)
+ SYS_LIBRARIES = -lsocket -lnsl
+ #endif
+ 
  ComplexProgramTarget(showfont)
  
*** mit/lib/Xt/Resources.c.orig	Thu Jun 13 23:03:44 1991
--- mit/lib/Xt/Resources.c	Wed Jul 15 14:05:13 1992
***************
*** 244,249 ****
--- 244,261 ----
  #undef xrmres
  } /* _XtCompileResourceList */
  
+ /*
+ ** db - for OLIT 3.0 compatibility... see Donna Converse's message
+ **	on Xpert dated Wed, 8 Jul 1992 16:29:03 GMT.
+ **	"Re: shared libs on Suns. (also:  R5 shared libraries)"
+ */
+ void XrmCompileResourceList(resources, num_resources)
+ 	XtResourceList	resources;
+ 	Cardinal	num_resources;
+ {
+ 	_XtCompileResourceList(resources, num_resources);
+ }
+ 
  /* Like _XtCompileResourceList, but strings are not permanent */
  static void  XrmCompileResourceListEphem(resources, num_resources)
      register XtResourceList resources;
*** mit/lib/Xt/Xtos.h.orig	Thu Dec 27 19:34:36 1990
--- mit/lib/Xt/Xtos.h	Fri Jul 17 11:22:48 1992
***************
*** 73,79 ****
--- 73,83 ----
   * Some System V boxes extract alloca.o from /lib/libPW.a; if you
   * decide that you don't want to use alloca, you might want to fix it here.
   */
+ #ifdef SVR4
+ #include <alloca.h>
+ #else
  char *alloca();
+ #endif
  #define ALLOCATE_LOCAL(size) alloca((int)(size))
  #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  #endif /* who does alloca */
*** mit/lib/Xt/Converters.c.orig	Tue Jul 23 19:39:00 1991
--- mit/lib/Xt/Converters.c	Wed Jul 15 14:01:55 1992
***************
*** 61,73 ****
  #define XtQVisual	XrmPermStringToQuark(XtRVisual)
  
  static XrmQuark  XtQBool;
! static XrmQuark  XtQBoolean;
  static XrmQuark  XtQColor;
  static XrmQuark  XtQDimension;
! static XrmQuark  XtQFont;
  static XrmQuark  XtQFontSet;
! static XrmQuark  XtQFontStruct;
! static XrmQuark  XtQInt;
  static XrmQuark  XtQPixel;
  static XrmQuark  XtQPosition;
  XrmQuark  _XtQString;
--- 61,73 ----
  #define XtQVisual	XrmPermStringToQuark(XtRVisual)
  
  static XrmQuark  XtQBool;
! XrmQuark  XtQBoolean;
  static XrmQuark  XtQColor;
  static XrmQuark  XtQDimension;
! XrmQuark  XtQFont;
  static XrmQuark  XtQFontSet;
! XrmQuark  XtQFontStruct;
! XrmQuark  XtQInt;
  static XrmQuark  XtQPixel;
  static XrmQuark  XtQPosition;
  XrmQuark  _XtQString;
*** mit/clients/xterm/main.c.orig	Fri Mar 20 14:22:44 1992
--- mit/clients/xterm/main.c	Fri Jul 24 14:55:11 1992
***************
*** 1504,1510 ****
  	char buf[64];
  	char *TermName = NULL;
  	int ldisc = 0;
! #ifdef sun
  #ifdef TIOCSSIZE
  	struct ttysize ts;
  #endif	/* TIOCSSIZE */
--- 1504,1513 ----
  	char buf[64];
  	char *TermName = NULL;
  	int ldisc = 0;
! #ifdef USE_TERMIOS
! 	struct winsize ws;
! #else /* ~ USE_TERMIOS */
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCSSIZE
  	struct ttysize ts;
  #endif	/* TIOCSSIZE */
***************
*** 1513,1518 ****
--- 1516,1522 ----
  	struct winsize ws;
  #endif	/* TIOCSWINSZ */
  #endif	/* sun */
+ #endif	/* USE_TERMIOS */
  	struct passwd *pw = NULL;
  #ifdef UTMP
  	struct utmp utmp;
***************
*** 1710,1716 ****
  	    }
  	}
  
! #ifdef sun
  #ifdef TIOCSSIZE
  	/* tell tty how big window is */
  	if(screen->TekEmu) {
--- 1714,1720 ----
  	    }
  	}
  
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCSSIZE
  	/* tell tty how big window is */
  	if(screen->TekEmu) {
***************
*** 2354,2360 ****
  		    if(handshake.rows > 0 && handshake.cols > 0) {
  			screen->max_row = handshake.rows;
  			screen->max_col = handshake.cols;
! #ifdef sun
  #ifdef TIOCSSIZE
  			ts.ts_lines = screen->max_row + 1;
  			ts.ts_cols = screen->max_col + 1;
--- 2358,2364 ----
  		    if(handshake.rows > 0 && handshake.cols > 0) {
  			screen->max_row = handshake.rows;
  			screen->max_col = handshake.cols;
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCSSIZE
  			ts.ts_lines = screen->max_row + 1;
  			ts.ts_cols = screen->max_col + 1;
***************
*** 2410,2416 ****
  
  
  		/* need to reset after all the ioctl bashing we did above */
! #ifdef sun
  #ifdef TIOCSSIZE
  		ioctl  (0, TIOCSSIZE, &ts);
  #endif	/* TIOCSSIZE */
--- 2414,2420 ----
  
  
  		/* need to reset after all the ioctl bashing we did above */
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCSSIZE
  		ioctl  (0, TIOCSSIZE, &ts);
  #endif	/* TIOCSSIZE */
*** mit/clients/xterm/resize.c.orig	Tue Jul 23 15:12:14 1991
--- mit/clients/xterm/resize.c	Fri Jul 24 14:28:47 1992
***************
*** 130,136 ****
  	"\0337\033[r\033[999;999H\033[6n",
  	"\033[18t",
  };
! #ifndef sun
  #ifdef TIOCSWINSZ
  char *getwsize[EMULATIONS] = {	/* size in pixels */
  	0,
--- 130,136 ----
  	"\0337\033[r\033[999;999H\033[6n",
  	"\033[18t",
  };
! #if defined(SVR4) || !defined(sun)
  #ifdef TIOCSWINSZ
  char *getwsize[EMULATIONS] = {	/* size in pixels */
  	0,
***************
*** 159,165 ****
  char sunname[] = "sunsize";
  int tty;
  FILE *ttyfp;
! #ifndef sun
  #ifdef TIOCSWINSZ
  char *wsize[EMULATIONS] = {
  	0,
--- 159,165 ----
  char sunname[] = "sunsize";
  int tty;
  FILE *ttyfp;
! #if defined(SVR4) || !defined(sun)
  #ifdef TIOCSWINSZ
  char *wsize[EMULATIONS] = {
  	0,
***************
*** 195,201 ****
  	char newtc [1024];
  #endif /* USE_TERMCAP */
  	char buf[BUFSIZ];
! #ifdef sun
  #ifdef TIOCSSIZE
  	struct ttysize ts;
  #endif	/* TIOCSSIZE */
--- 195,201 ----
  	char newtc [1024];
  #endif /* USE_TERMCAP */
  	char buf[BUFSIZ];
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCSSIZE
  	struct ttysize ts;
  #endif	/* TIOCSSIZE */
***************
*** 335,341 ****
  	}
  	if(restore[emu])
  		write(tty, restore[emu], strlen(restore[emu]));
! #ifdef sun
  #ifdef TIOCGSIZE
  	/* finally, set the tty's window size */
  	if (ioctl (tty, TIOCGSIZE, &ts) != -1) {
--- 335,341 ----
  	}
  	if(restore[emu])
  		write(tty, restore[emu], strlen(restore[emu]));
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCGSIZE
  	/* finally, set the tty's window size */
  	if (ioctl (tty, TIOCGSIZE, &ts) != -1) {
***************
*** 419,424 ****
--- 419,428 ----
  #ifndef SVR4
  		printf ("%sCOLUMNS=%d;\nLINES=%d;\nexport COLUMNS LINES;\n",
  			setname, cols, rows);
+ #else
+ /* Added db */
+ 		printf ("%sCOLUMNS=%d;\nLINES=%d;\nexport COLUMNS LINES;\n",
+ 			setname, cols, rows);
  #endif /* !SVR4 */
  #endif	/* USE_SYSV_TERMCAP */
  
***************
*** 429,434 ****
--- 433,442 ----
  		 setname, termcap);
  #else /* else not USE_TERMCAP */
  #ifndef SVR4
+ 		printf ("set noglob;\n%ssetenv COLUMNS '%d';\nsetenv LINES '%d';\nunset noglob;\n",
+ 			setname, cols, rows);
+ #else
+ /* Added db */
  		printf ("set noglob;\n%ssetenv COLUMNS '%d';\nsetenv LINES '%d';\nunset noglob;\n",
  			setname, cols, rows);
  #endif /* !SVR4 */
*** mit/clients/xterm/screen.c.orig	Thu Aug 22 20:30:38 1991
--- mit/clients/xterm/screen.c	Fri Jul 24 15:06:06 1992
***************
*** 485,491 ****
  	int rows, cols;
  	int border = 2 * screen->border;
  	int move_down_by;
! #ifdef sun
  #ifdef TIOCSSIZE
  	struct ttysize ts;
  #endif	/* TIOCSSIZE */
--- 485,491 ----
  	int rows, cols;
  	int border = 2 * screen->border;
  	int move_down_by;
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCSSIZE
  	struct ttysize ts;
  #endif	/* TIOCSSIZE */
***************
*** 579,585 ****
  	screen->fullVwin.fullheight = height;
  	screen->fullVwin.fullwidth = width;
  	ResizeSelection (screen, rows, cols);
! #ifdef sun
  #ifdef TIOCSSIZE
  	/* Set tty's idea of window size */
  	ts.ts_lines = rows;
--- 579,585 ----
  	screen->fullVwin.fullheight = height;
  	screen->fullVwin.fullwidth = width;
  	ResizeSelection (screen, rows, cols);
! #if defined(sun) && !defined(SVR4)
  #ifdef TIOCSSIZE
  	/* Set tty's idea of window size */
  	ts.ts_lines = rows;
*** mit/clients/xload/get_load.c.orig	Thu Jul 25 18:21:17 1991
--- mit/clients/xload/get_load.c	Thu Jul 23 13:09:47 1992
***************
*** 386,392 ****
--- 386,396 ----
   */
  #ifndef KERNEL_FILE
  #ifdef SVR4
+ #ifdef sun
+ #define KERNEL_FILE "/kernel/unix"
+ #else
  #define KERNEL_FILE "/stand/unix"
+ #endif
  #else
  #ifdef SYSV
  #define KERNEL_FILE "/unix"
No differences encountered
*** mit/clients/twm/lex.l.orig	Fri Dec 15 19:02:02 1989
--- mit/clients/twm/lex.l	Thu Jul 23 12:07:18 1992
***************
*** 87,93 ****
--- 87,95 ----
  				  ParseError = 1;
  				}
  %%
+ #ifndef yywrap
  yywrap() { return(1);}
+ #endif
  
  #undef unput
  #undef input
*** mit/clients/twm/Imakefile.orig	Wed Jul 17 04:48:07 1991
--- mit/clients/twm/Imakefile	Thu Jul 23 12:21:06 1992
***************
*** 20,25 ****
--- 20,32 ----
  		parse.o menus.o events.o resize.o util.o version.o iconmgr.o \
  		cursor.o icons.o
  
+ #ifdef LexCmd
+ LEX=LexCmd
+ #endif
+ #ifdef YaccCmd
+ YACC=YaccCmd
+ #endif
+ 
  AllTarget(twm)
  
  SpecialObjectRule(parse.o,NullParameter,'-DSYSTEM_INIT_FILE="'$(TWMDIR)'/system.twmrc"')
***************
*** 33,39 ****
  InstallNonExecFile(system.twmrc,$(TWMDIR))
  
  gram.h gram.c: gram.y
! 	yacc $(YFLAGS) gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
--- 40,46 ----
  InstallNonExecFile(system.twmrc,$(TWMDIR))
  
  gram.h gram.c: gram.y
! 	${YACC} $(YFLAGS) gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
*** mit/clients/xconsole/xconsole.c.orig	Thu Jul 25 18:24:34 1991
--- mit/clients/xconsole/xconsole.c	Mon Jul 27 08:10:07 1992
***************
*** 110,115 ****
--- 110,127 ----
  #define FILE_NAME   "/dev/xcons"
  #endif
  
+ #if defined(sun) && defined(SVR4)
+ #define	USE_WSCONS
+ 
+ #include	<termios.h>
+ #include	<sys/stropts.h>		/* for I_PUSH */
+ #include	<sys/strredir.h>
+ 
+ static int  tty_fd, pty_fd;
+ static char ttydev[64], ptydev[64];
+ 
+ #else
+ 
  #ifndef USE_FILE
  #include    <sys/ioctl.h>
  #ifdef SVR4
***************
*** 124,129 ****
--- 136,143 ----
  #endif
  #endif
  
+ #endif
+ 
  #if defined(SYSV) && defined(SYSV386)
  #define USE_OSM
  #endif
***************
*** 161,166 ****
--- 175,192 ----
  	    /* Don't have to be owner of /dev/console when using /dev/osm. */
  	    input = fdopen(osm_pipe(), "r");
  #endif
+ #ifdef USE_WSCONS
+ 	    {
+ 		int	cons;
+ 
+ 		if ((cons = open("/dev/console", O_RDONLY)) >= 0) {
+ 			if (get_pty(&pty_fd, &tty_fd, ttydev, ptydev) == 0 &&
+ 				ioctl(cons, SRIOCSREDIR, tty_fd) != -1)
+ 					input = fdopen(pty_fd, "r");
+ 		}
+ 	    }
+ #endif /* WSCONS */
+ 
  	    if (input && app_resources.verbose)
  	    {
  		char	*hostname;
***************
*** 588,594 ****
  	XawTextSetInsertionPoint (w, len);
  }
  
! #ifdef USE_PTY
  /* This function opens up a pty master and stuffs it's value into pty.
   * If it finds one, it returns a value of 0.  If it does not find one,
   * it returns a value of !0.  This routine is designed to be re-entrant,
--- 614,620 ----
  	XawTextSetInsertionPoint (w, len);
  }
  
! #if defined(USE_PTY) || defined(USE_WSCONS)
  /* This function opens up a pty master and stuffs it's value into pty.
   * If it finds one, it returns a value of 0.  If it does not find one,
   * it returns a value of !0.  This routine is designed to be re-entrant,
*** mit/clients/xconsole/Imakefile.orig	Wed Jul 17 03:07:12 1991
--- mit/clients/xconsole/Imakefile	Mon Jul 27 08:32:40 1992
***************
*** 7,10 ****
--- 7,17 ----
  
  ComplexProgramTarget(xconsole)
  
+ #if defined(SunArchitecture) && defined(SystemV4)
+ InstallProgramWithFlags($(PROGRAMS),$(BINDIR),$(INSTUIDFLAGS))
+ #else
+ InstallProgramWithFlags($(PROGRAMS),$(BINDIR),NullParameter)
+ #endif
+ 
+ 
  InstallAppDefaults(XConsole)
*** mit/demos/xgc/Imakefile.orig	Mon Jul 22 16:07:27 1991
--- mit/demos/xgc/Imakefile	Fri Jul 24 07:50:59 1992
***************
*** 11,22 ****
    SYS_LIBRARIES = -lm
           YFLAGS = -d
  
  ComplexProgramTarget(xgc)
  
  InstallAppDefaults(Xgc)
  
  gram.h gram.c: gram.y
! 	yacc -d gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
--- 11,29 ----
    SYS_LIBRARIES = -lm
           YFLAGS = -d
  
+ #ifdef	YaccCmd
+ YACC=	YaccCmd
+ #endif
+ #ifdef	LexCmd
+ LEX=	LexCmd
+ #endif
+ 
  ComplexProgramTarget(xgc)
  
  InstallAppDefaults(Xgc)
  
  gram.h gram.c: gram.y
! 	${YACC} -d gram.y
  	$(MV) y.tab.c gram.c
  	$(MV) y.tab.h gram.h
  
*** mit/server/ddx/sun/sunCG6C.c.orig	Fri Jul 26 23:17:06 1991
--- mit/server/ddx/sun/sunCG6C.c	Mon Jul 27 11:04:03 1992
***************
*** 39,50 ****
  
  #ifdef FBTYPE_SUNFAST_COLOR
  #include    <sys/mman.h>
  #include    <pixrect/memreg.h>
  #include    "colormap.h"
  #include    "colormapst.h"
  #include    "resource.h"
  #include    <cfb.h>
- #include    <struct.h>
  
  #define CG6_VBASE	0x70000000
  
--- 39,54 ----
  
  #ifdef FBTYPE_SUNFAST_COLOR
  #include    <sys/mman.h>
+ #ifdef SVR4
+ #include    <sys/memreg.h>
+ #else
  #include    <pixrect/memreg.h>
+ #include    <struct.h>
+ #endif
  #include    "colormap.h"
  #include    "colormapst.h"
  #include    "resource.h"
  #include    <cfb.h>
  
  #define CG6_VBASE	0x70000000
  
*** mit/server/ddx/sun/sunCG.c.orig	Fri Aug 23 20:12:45 1991
--- mit/server/ddx/sun/sunCG.c	Mon Jul 27 10:57:15 1992
***************
*** 32,41 ****
--- 32,47 ----
  #include    "sun.h"
  
  #include    <sys/mman.h>
+ #ifdef SVR4
+ #include    <sys/memreg.h>
+ #else
  #include    <pixrect/memreg.h>
+ #endif
  #include    "colormapst.h"
  #include    "resource.h"
+ #ifndef SVR4
  #include    <struct.h>
+ #endif
  
  extern int TellLostMap(), TellGainedMap();
  
*** mit/server/ddx/sun/sunCG2M.c.orig	Fri May 31 20:06:15 1991
--- mit/server/ddx/sun/sunCG2M.c	Mon Jul 27 10:59:54 1992
***************
*** 25,33 ****
--- 25,38 ----
  #include    "resource.h"
  
  #include    <sys/mman.h>
+ #ifdef SVR4
+ #include    <sys/memreg.h>
+ #include    <sys/cg2reg.h>
+ #else
  #include    <pixrect/memreg.h>
  #include    <pixrect/cg2reg.h>
  #include    <struct.h>
+ #endif
  
  #ifndef _MAP_NEW
  extern caddr_t valloc();
*** mit/server/ddx/sun/kbd_mode.c.orig	Thu Sep 10 22:24:42 1987
--- mit/server/ddx/sun/kbd_mode.c	Mon Jul 27 10:40:33 1992
***************
*** 36,46 ****
--- 36,55 ----
   *      kbd_mode:       set keyboard encoding mode
   */
  
+ #ifdef SVR4
+ #include <sys/fcntl.h>
+ #endif
+ 
  #include <sys/types.h>
  #include <sys/file.h>
  #include <sys/ioctl.h>
+ #ifdef SVR4
+ #include <sys/kbio.h>
+ #include <sys/kbd.h>
+ #else
  #include <sundev/kbio.h>
  #include <sundev/kbd.h>
+ #endif
  #include <stdio.h>
  
  static void         die(), usage();
*** mit/server/ddx/sun/sun.h.orig	Mon Mar  2 12:54:22 1992
--- mit/server/ddx/sun/sun.h	Mon Jul 27 10:35:53 1992
***************
*** 17,22 ****
--- 17,26 ----
  #ifndef _SUN_H_
  #define _SUN_H_
  
+ #ifdef SVR4
+ #include    <unistd.h>
+ #endif
+ 
  #include    <errno.h>
  extern int  errno;
  #include    <sys/param.h>
***************
*** 25,34 ****
--- 29,45 ----
  #include    <sys/file.h>
  #include    <sys/fcntl.h>
  #include    <sys/signal.h>
+ #ifdef SVR4
+ #include    <sys/kbd.h>
+ #include    <sys/kbio.h>
+ #include    <sys/msio.h>
+ #include    <sys/fbio.h>
+ #else
  #include    <sundev/kbd.h>
  #include    <sundev/kbio.h>
  #include    <sundev/msio.h>
  #include    <sun/fbio.h>
+ #endif
  
  /*
   * SUN_WINDOWS is now defined (or not) by the Makefile
***************
*** 49,55 ****
--- 60,70 ----
  #include    <sunwindow/win_struct.h>
  #else 
  /* already included by sunwindow/win_input.h */
+ #ifdef SVR4
+ #include    <sys/vuid_event.h>
+ #else
  #include    <sundev/vuid_event.h>
+ #endif
  #endif /* SUN_WINDOWS */
  
  #include    "X.h"
*** mit/server/ddx/sun/sunCG3C.c.orig	Fri May 31 20:06:24 1991
--- mit/server/ddx/sun/sunCG3C.c	Mon Jul 27 11:01:40 1992
***************
*** 34,40 ****
--- 34,45 ----
  #include    "sun.h"
  
  #include    <sys/mman.h>
+ #ifdef SVR4
+ #include    <sys/memreg.h>
+ #else
  #include    <pixrect/memreg.h>
+ #include    <struct.h>
+ #endif
  /*
  #include    <sundev/cg4reg.h>
  */
***************
*** 41,47 ****
  #include    "colormap.h"
  #include    "colormapst.h"
  #include    "resource.h"
- #include    <struct.h>
  
  /*-
   * The cg3 frame buffer is divided into several pieces.
--- 46,51 ----
*** mit/server/ddx/sun/sunCG4C.c.orig	Fri May 31 20:06:22 1991
--- mit/server/ddx/sun/sunCG4C.c	Mon Jul 27 11:02:45 1992
***************
*** 38,49 ****
  #include    "sun.h"
  
  #include    <sys/mman.h>
  #include    <pixrect/memreg.h>
  #include    <sundev/cg4reg.h>
  #include    "colormap.h"
  #include    "colormapst.h"
  #include    "resource.h"
- #include    <struct.h>
  
  /*-
   * The cg4 frame buffer is divided into several pieces.
--- 38,54 ----
  #include    "sun.h"
  
  #include    <sys/mman.h>
+ #ifdef SVR4
+ #include    <sys/memreg.h>
+ #include    <sys/cg4reg.h>
+ #else
  #include    <pixrect/memreg.h>
  #include    <sundev/cg4reg.h>
+ #include    <struct.h>
+ #endif
  #include    "colormap.h"
  #include    "colormapst.h"
  #include    "resource.h"
  
  /*-
   * The cg4 frame buffer is divided into several pieces.
*** mit/server/ddx/sun/sunKbd.c.orig	Mon Mar  2 13:08:08 1992
--- mit/server/ddx/sun/sunKbd.c	Mon Jul 27 10:52:59 1992
***************
*** 56,61 ****
--- 56,65 ----
  #include <signal.h>
  #include <sys/ioctl.h>
  
+ #ifdef SVR4
+ #include <sys/filio.h>
+ #endif
+ 
  typedef struct {
      int	    	  trans;          	/* Original translation form */
  } SunKbPrivRec, *SunKbPrivPtr;
*** mit/server/ddx/sun/sunBW2.c.orig	Fri May 31 20:06:18 1991
--- mit/server/ddx/sun/sunBW2.c	Mon Jul 27 10:49:28 1992
***************
*** 57,63 ****
--- 57,67 ----
  #include    "resource.h"
  
  #include    <sys/mman.h>
+ #ifdef SVR4
+ #include    <sys/bw2reg.h>
+ #else
  #include    <sundev/bw2reg.h>
+ #endif
  
  extern caddr_t mmap();
  
*** mit/server/ddx/sun/constype.c.orig	Tue Sep 26 23:57:12 1989
--- mit/server/ddx/sun/constype.c	Mon Jul 27 10:47:59 1992
***************
*** 38,44 ****
--- 38,50 ----
  style.
  */
  #include <stdio.h>
+ #ifdef SVR4
+ #include <string.h>
+ #include <sys/machtypes.h>
+ #include <fcntl.h>
+ #else
  #include <strings.h>
+ #endif
  
  main (argc, argv)
      int argc;
***************
*** 60,66 ****
--- 66,76 ----
  }
  #include <sys/ioctl.h>
  #include <sys/file.h>
+ #ifdef SVR4
+ #include <sys/fbio.h>
+ #else
  #include <sun/fbio.h>
+ #endif
  
  /* decoding as of Release 3.4 : fbio.h 1.3 87/01/09 SMI */
  	/* the convention for entries in this table is to translate the
*** mit/server/ddx/sun/sunCG2C.c.orig	Fri May 31 20:06:20 1991
--- mit/server/ddx/sun/sunCG2C.c	Mon Jul 27 10:58:55 1992
***************
*** 38,46 ****
--- 38,51 ----
  #include    "sun.h"
  
  #include    <sys/mman.h>
+ #ifdef SVR4
+ #include    <sys/memreg.h>
+ #include    <sys/cg2reg.h>
+ #else
  #include    <struct.h>
  #include    <pixrect/memreg.h>
  #include    <pixrect/cg2reg.h>
+ #endif
  #include    "colormap.h"
  #include    "colormapst.h"
  #include    "resource.h"
*** mit/server/ddx/sun/Imakefile.orig	Mon Jul 29 22:27:50 1991
--- mit/server/ddx/sun/Imakefile	Mon Jul 27 10:29:13 1992
***************
*** 1,7 ****
  XCOMM $XConsortium: Imakefile,v 5.13 91/07/29 18:26:59 rws Exp $
  #include <Server.tmpl>
  
! #ifdef SparcArchitecture
  #if HasMITGXSource
  GXSRC=sunGX.c
  #else
--- 1,7 ----
  XCOMM $XConsortium: Imakefile,v 5.13 91/07/29 18:26:59 rws Exp $
  #include <Server.tmpl>
  
! #if defined(SparcArchitecture) && !defined(SystemV4)
  #if HasMITGXSource
  GXSRC=sunGX.c
  #else








: This is a shell archive file. Remove everything above this line
: to unbundle. chmod +x "thisfile", then run it: e.g. % thisfile
: SHAR archive format.  Archive created Tue Jul 28 14:48:37 MET DST 1992
: file contains: 
:     mit/config/sun.cf
echo x - sun.cf
sed 's/^X//' > sun.cf <<'+END+OF+sun.cf'
XXCOMM platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
X
X#define	SVR4
X
X#ifdef SVR4
X#define OSName            SunOS 5.0
X#define OSMajorVersion    5
X#define OSMinorVersion    0
X#define OSTeenyVersion    0
X#else
X#define OSName            SunOS 4.1.1
X#define OSMajorVersion    4
X#define OSMinorVersion    1
X#define OSTeenyVersion    1
X#endif
X
XXCOMM operating system:  OSName
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 == 5
X/*
X** Solaris 2.0
X*/
X#define	SystemV4		YES
X#define	HasSockets		YES
X#define	SunPost411FCSLd		YES
X#define	CcCmd			cc		/* This had better been /opt/SUNWste/bin/cc */
X#define DefaultCCOptions	-Xc
X#define	CppCmd			/usr/ccs/lib/cpp
X#define	ArCmd			ar cq
X#define	DoRanlibCmd		0
X#define	BootstrapCFlags		-DSVR4 -Xc -Dsun -Dsparc -Dunix
X#define	StandardDefines		-DSVR4 -Xc -Dsun -Dsparc -Dunix
X#define	StandardCppDefines	-DSVR4 -Dsun -Dsparc -Dunix
X#define SharedLibraryLoadFlags	-G		/* Left out "-z text" -- don't know why */
X#define	InstKmemFlags		-g root -m 2755
X
X/*
X** If you have no Sun C compiler.
X*/
X#if	UseCygnusTools
X#ifdef	YaccCmd
X#undef	YaccCmd
X#endif
X#define	YaccCmd			byacc
X
X#ifdef	LexCmd
X#undef	LexCmd
X#endif
X#define	LexCmd			flex
X
X#ifdef	CcCmd
X#undef	CcCmd
X#endif
X#define	CcCmd			gcc
X#ifdef	DefaultCCOptions
X#undef	DefaultCCOptions
X#endif
X#define	DefaultCCOptions	-ansi -DSVR4
X#endif
X
X#define SetTtyGroup	  NO
X#else
X/*
X** Stuff NOT for Solaris 2.0
X*/
X#define SetTtyGroup	  YES
X#define InstKmemFlags	  -g kmem -m 2755
X#endif
X
X#define HasSaberC	  YES		/* for machines that have it */
X#define HasNdbm		  YES
X#define HasShm		  YES
X#define HasSecureRPC	  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
X#ifdef	InstallCmd
X#undef	InstallCmd
X#endif
X#define	InstallCmd	install
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#ifdef SVR4
X#include <sv4Lib.rules>
X#else
X#include <sunLib.rules>
X#endif
X
X#if HasGcc
X
X#define OptimizedCDebugFlags -O
X#if defined(HasGcc2) 
X#define OptimizedCDebugFlags -O2
X#else
X#define SharedLibraryCcCmd cc
X#define ExtraLoadFlags -B/usr/bin/
X#define AllocateLocalDefines /**/
X#endif
X
X.c.o:
X	$(CC) -c $(CFLAGS) $*.c
X
X#else
X
X#define AllocateLocalDefines -DINCLUDE_ALLOCA_H
X
X#ifndef SVR4
X#ifdef mc68000
X#define DefaultCCOptions -f68881 -pipe
X#else
X#define DefaultCCOptions
X#endif
X#endif
X
X#define PexCCOptions DefaultCCOptions
X
X#endif
X
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
+END+OF+sun.cf
echo '-rw-r--r--  1 db           3234 Jul 27 15:59 sun.cf    (as sent)'
chmod u=rw,g=r,o=r sun.cf
ls -l sun.cf
exit 0

--
	Danny Backx
	System Engineer

E-Mail: db@sunbim.be    (or uunet!mcsun!ub4b!sunbim!db)

Telephone: +32(2)759.59.25	Fax : +32(2)759.47.95

Postal Mail :
	Danny Backx
	BIM
	Kwikstraat 4
	3078 Everberg
	Belgium
Newsgroups: comp.windows.x