From: brendan@cygnus.com (Brendan Kehoe)
Subject: Re: Lucid Emacs Patch for Solaris 2
Reply-To: brendan@cygnus.com
Organization: Cygnus Support, Palo Alto CA; Phone +1 415 322 3811
Date: Thu, 15 Oct 1992 18:57:57 GMT


Here are the same patches, tweaked slightly to work with gcc.

Changes to John's patch were:

* Don't change CPP, use $(CC) -E. (CC is assumed to be set to a
  copy of gcc.)
* Do define USE_GCC.
* In environ.c, make the argument to getenv match the one that's
  declared in its prototype (it's a register const char, not
  necessarily unsigned).
* In s-solaris.h, define LD_SWITCH_SYSTEM and C_SWITCH_SYSTEM to look
  for the OpenWindows headers and libraries in their normal place
  (/usr/openwin), rather than John's /depot/openwin-v3 directory.
* Use gcc as the LD_CMD.
* Since gcc defines __STDC__, it never sees the definition of NSIG in
  <sys/signal.h>.  s-solaris2.h has that added to the end of it if
  necessary.
* ymakefile shouldn't pass -nostdlib to gcc with Solaris.

You'll get a warning about duplicate definitions of __free (in nsl and
in gmalloc.o).  Ignore it.

------- Included Patch -- Cut Here -------
diff -c -N -p -r etc/b2m.c etc/b2m.c
*** etc/b2m.c	Mon Jun 29 18:28:08 1992
--- etc/b2m.c	Thu Sep 10 22:13:24 1992
***************
*** 17,23 ****
--- 17,31 ----
  
  #include <stdio.h>
  #include <time.h>
+ 
+ #define NO_SHORTNAMES
+ #include "../src/config.h"
+ 
+ #ifndef USG
  #include <strings.h>
+ #else
+ #include <string.h>
+ #endif
  
  /* Why can't Sun learn to write libraries and include files? */
  extern char *strtok ();
diff -c -N -p -r etc/etags.c etc/etags.c
*** etc/etags.c	Mon Jun 29 18:28:13 1992
--- etc/etags.c	Thu Sep 10 22:12:20 1992
*************** the Free Software Foundation, 675 Mass A
*** 31,36 ****
--- 31,39 ----
  #include <sys/types.h>
  #include <sys/stat.h>
  
+ #define NO_SHORTNAMES
+ #include "../src/config.h"
+ 
  extern char *malloc (), *realloc ();
  extern char *getenv ();
  extern char *index (), *rindex ();
*************** extern char *index (), *rindex ();
*** 37,43 ****
  extern char *strcpy (), *strncpy ();
  extern int strcmp ();
  
! #ifdef hpux
  #define notdef
  #endif
  
--- 40,46 ----
  extern char *strcpy (), *strncpy ();
  extern int strcmp ();
  
! #if defined(hpux) || defined(USG5_4)
  #define notdef
  #endif
  
diff -c -N -p -r src/Makefile src/Makefile
*** src/Makefile	Wed Sep  9 04:10:01 1992
--- src/Makefile	Thu Sep 10 22:20:40 1992
*************** dorelease:
*** 40,46 ****
  xmakefile: ymakefile config.h
  	rm -f xmakefile
  	cp ymakefile junk.c
! 	$(CPP) junk.c | sed -e 's/^#.*//' -e 's/^[ \f\t][ \f\t]*$$//' -e 's/^ /	/' | \
  	sed -n -e '/^..*$$/p' > xmakefile
  	rm -f junk.c
  
--- 40,46 ----
  xmakefile: ymakefile config.h
  	rm -f xmakefile
  	cp ymakefile junk.c
! 	$(CPP) junk.c | sed -e 's/^#.*//' -e 's/^[ \f\t][ \f\t]*$$//' -e 's/^ /	/' -e 's/\//' | \
  	sed -n -e '/^..*$$/p' > xmakefile
  	rm -f junk.c
  
diff -c -N -p -r src/bitmaps.h src/bitmaps.h
*** src/bitmaps.h	Mon Jun 29 18:26:04 1992
--- src/bitmaps.h	Mon Oct 12 11:13:37 1992
***************
*** 1,7 ****
  /* A gnu, like on the back of the emacs manual, for icons. */
  #define gnu_width 50
  #define gnu_height 50
! static char gnu_bits[] = {
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff,
--- 1,7 ----
  /* A gnu, like on the back of the emacs manual, for icons. */
  #define gnu_width 50
  #define gnu_height 50
! static unsigned char gnu_bits[] = {
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff,
*************** static char gnu_bits[] = {
*** 37,43 ****
  /* Vertical bars */
  #define compress_width 16
  #define compress_height 10
! static char compress_bits[] = {
     0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
     0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66};
  
--- 37,43 ----
  /* Vertical bars */
  #define compress_width 16
  #define compress_height 10
! static unsigned char compress_bits[] = {
     0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
     0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66};
  
*************** static char compress_bits[] = {
*** 44,50 ****
  /* Bracketed dash */
  #define compress_width 15
  #define compress_height 10
! static char compress_bits[] = {
     0x1f, 0x7c, 0x1f, 0x7c, 0x03, 0x60, 0x03, 0x60, 0xe3, 0x63, 0xe3, 0x63,
     0x03, 0x60, 0x03, 0x60, 0x1f, 0x7c, 0x1f, 0x7c};
  #endif
--- 44,50 ----
  /* Bracketed dash */
  #define compress_width 15
  #define compress_height 10
! static unsigned char compress_bits[] = {
     0x1f, 0x7c, 0x1f, 0x7c, 0x03, 0x60, 0x03, 0x60, 0xe3, 0x63, 0xe3, 0x63,
     0x03, 0x60, 0x03, 0x60, 0x1f, 0x7c, 0x1f, 0x7c};
  #endif
*************** static char compress_bits[] = {
*** 52,64 ****
  /* Rectangled dash */
  #define compress_width 15
  #define compress_height 10
! static char compress_bits[] = {
     0xff, 0x7f, 0xff, 0x7f, 0x03, 0x60, 0x03, 0x60, 0xe3, 0x63, 0xe3, 0x63,
     0x03, 0x60, 0x03, 0x60, 0xff, 0x7f, 0xff, 0x7f};
  
  #define extent_begin_width 18
  #define extent_begin_height 10
! static char extent_begin_bits[] = {
     0x0c, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0x0c, 0x00, 0xcc, 0xcc, 0x00,
     0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0x0c, 0x00,
     0xcc, 0x00, 0x00, 0x0c, 0x00, 0x00};
--- 52,64 ----
  /* Rectangled dash */
  #define compress_width 15
  #define compress_height 10
! static unsigned char compress_bits[] = {
     0xff, 0x7f, 0xff, 0x7f, 0x03, 0x60, 0x03, 0x60, 0xe3, 0x63, 0xe3, 0x63,
     0x03, 0x60, 0x03, 0x60, 0xff, 0x7f, 0xff, 0x7f};
  
  #define extent_begin_width 18
  #define extent_begin_height 10
! static unsigned char extent_begin_bits[] = {
     0x0c, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0x0c, 0x00, 0xcc, 0xcc, 0x00,
     0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0x0c, 0x00,
     0xcc, 0x00, 0x00, 0x0c, 0x00, 0x00};
*************** static char extent_begin_bits[] = {
*** 65,71 ****
  
  #define extent_end_width 18
  #define extent_end_height 10
! static char extent_end_bits[] = {
     0x00, 0xc0, 0x00, 0x00, 0xcc, 0x00, 0xc0, 0xcc, 0x00, 0xcc, 0xcc, 0x00,
     0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xc0, 0xcc, 0x00,
     0x00, 0xcc, 0x00, 0x00, 0xc0, 0x00};
--- 65,71 ----
  
  #define extent_end_width 18
  #define extent_end_height 10
! static unsigned char extent_end_bits[] = {
     0x00, 0xc0, 0x00, 0x00, 0xcc, 0x00, 0xc0, 0xcc, 0x00, 0xcc, 0xcc, 0x00,
     0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0xc0, 0xcc, 0x00,
     0x00, 0xcc, 0x00, 0x00, 0xc0, 0x00};
*************** static char extent_end_bits[] = {
*** 74,86 ****
  /* A diamond. */
  #define continuer_width 8
  #define continuer_height 10
! static char continuer_bits[] = {
     0x18, 0x18, 0x34, 0x34, 0x62, 0x62, 0x34, 0x34, 0x18, 0x18};
  
  /* A left-pointing triangle. */
  #define truncator_width 8
  #define truncator_height 10
! static char truncator_bits[] = {
     0x40, 0x60, 0x70, 0x78, 0x7c, 0x7c, 0x78, 0x70, 0x60, 0x40};
  #endif
  
--- 74,86 ----
  /* A diamond. */
  #define continuer_width 8
  #define continuer_height 10
! static unsigned char continuer_bits[] = {
     0x18, 0x18, 0x34, 0x34, 0x62, 0x62, 0x34, 0x34, 0x18, 0x18};
  
  /* A left-pointing triangle. */
  #define truncator_width 8
  #define truncator_height 10
! static unsigned char truncator_bits[] = {
     0x40, 0x60, 0x70, 0x78, 0x7c, 0x7c, 0x78, 0x70, 0x60, 0x40};
  #endif
  
*************** static char truncator_bits[] = {
*** 87,104 ****
  /* An arrow pointing to the next line */
  #define continuer_width 7
  #define continuer_height 10
! static char continuer_bits[] = {
     0x00, 0xbc, 0xfc, 0xe0, 0xe0, 0x72, 0x3e, 0x1e, 0x1e, 0x3e};
  
  /* Three dots indicating truncation */
  #define truncator_width 7
  #define truncator_height 8
! static char truncator_bits[] = {
     0x06, 0x06, 0x00, 0x18, 0x18, 0x00, 0x60, 0x60};
  
  #define rarrow_width 12
  #define rarrow_height 10
! static char rarrow_bits[] = {
     0x40, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x80, 0x03, 0xfe, 0x07, 0xfe, 0x07,
     0x80, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x40, 0x00};
  
--- 87,104 ----
  /* An arrow pointing to the next line */
  #define continuer_width 7
  #define continuer_height 10
! static unsigned char continuer_bits[] = {
     0x00, 0xbc, 0xfc, 0xe0, 0xe0, 0x72, 0x3e, 0x1e, 0x1e, 0x3e};
  
  /* Three dots indicating truncation */
  #define truncator_width 7
  #define truncator_height 8
! static unsigned char truncator_bits[] = {
     0x06, 0x06, 0x00, 0x18, 0x18, 0x00, 0x60, 0x60};
  
  #define rarrow_width 12
  #define rarrow_height 10
! static unsigned char rarrow_bits[] = {
     0x40, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x80, 0x03, 0xfe, 0x07, 0xfe, 0x07,
     0x80, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x40, 0x00};
  
*************** static char rarrow_bits[] = {
*** 107,113 ****
  /* A stipple for hilighting. */
  #define selection_width 16
  #define selection_height 16
! static char selection_bits[] = {
     0x04, 0x84, 0x80, 0x00, 0x00, 0x20, 0x02, 0x04, 0x40, 0x00, 0x08, 0x82,
     0x00, 0x10, 0x40, 0x00, 0x02, 0x40, 0x00, 0x02, 0x10, 0x00, 0x80, 0x80,
     0x00, 0x08, 0x08, 0x00, 0x01, 0x02, 0x40, 0x20};
--- 107,113 ----
  /* A stipple for hilighting. */
  #define selection_width 16
  #define selection_height 16
! static unsigned char selection_bits[] = {
     0x04, 0x84, 0x80, 0x00, 0x00, 0x20, 0x02, 0x04, 0x40, 0x00, 0x08, 0x82,
     0x00, 0x10, 0x40, 0x00, 0x02, 0x40, 0x00, 0x02, 0x10, 0x00, 0x80, 0x80,
     0x00, 0x08, 0x08, 0x00, 0x01, 0x02, 0x40, 0x20};
*************** static char selection_bits[] = {
*** 114,120 ****
  
  #define secondary_selection_width 16
  #define secondary_selection_height 16
! static char secondary_selection_bits[] = {
     0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x80, 0x80, 0x40, 0x40,
     0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01,
     0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10};
--- 114,120 ----
  
  #define secondary_selection_width 16
  #define secondary_selection_height 16
! static unsigned char secondary_selection_bits[] = {
     0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x80, 0x80, 0x40, 0x40,
     0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01,
     0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10};
*************** static char secondary_selection_bits[] =
*** 121,127 ****
  
  #define overlap_selection_width 16
  #define overlap_selection_height 16
! static char overlap_selection_bits[] = {
     0x09, 0x88, 0x84, 0x04, 0x02, 0x22, 0x01, 0x05, 0x80, 0x80, 0x48, 0x42,
     0x20, 0x20, 0x50, 0x10, 0x0a, 0x48, 0x04, 0x04, 0x12, 0x02, 0x01, 0x01,
     0x80, 0x88, 0x48, 0x40, 0x21, 0xa2, 0x50, 0x10};
--- 121,127 ----
  
  #define overlap_selection_width 16
  #define overlap_selection_height 16
! static unsigned char overlap_selection_bits[] = {
     0x09, 0x88, 0x84, 0x04, 0x02, 0x22, 0x01, 0x05, 0x80, 0x80, 0x48, 0x42,
     0x20, 0x20, 0x50, 0x10, 0x0a, 0x48, 0x04, 0x04, 0x12, 0x02, 0x01, 0x01,
     0x80, 0x88, 0x48, 0x40, 0x21, 0xa2, 0x50, 0x10};
*************** static char overlap_selection_bits[] = {
*** 128,134 ****
  
  #define default0_stipple_width 16
  #define default0_stipple_height 16
! static char default0_stipple_bits[] = {
     0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66,
     0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00,
     0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00};
--- 128,134 ----
  
  #define default0_stipple_width 16
  #define default0_stipple_height 16
! static unsigned char default0_stipple_bits[] = {
     0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66,
     0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00,
     0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00};
*************** static char default0_stipple_bits[] = {
*** 135,141 ****
  
  #define default1_stipple_width 16
  #define default1_stipple_height 16
! static char default1_stipple_bits[] = {
     0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22,
     0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00,
     0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00};
--- 135,141 ----
  
  #define default1_stipple_width 16
  #define default1_stipple_height 16
! static unsigned char default1_stipple_bits[] = {
     0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22,
     0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00,
     0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00};
diff -c -N -p -r src/config.h src/config.h
*** src/config.h.~1~	Sun Aug 30 14:46:56 1992
--- src/config.h	Thu Oct 15 13:08:24 1992
***************
*** 36,46 ****
  /* #define USE_LCC */
  
- /* Include here a s- file that describes the system type you are using.
-    See the file ../etc/MACHINES for a list of systems and the names of
-    the s- files to use for them.  See s-template.h for documentation on 
-    writing s- files.
-  */
- #include "s/s-sunos4.h"
- 
  /* Include here a m- file that describes the machine and system you use.
     See the file ../etc/MACHINES for a list of machines and the names of 
--- 36,39 ----
***************
*** 50,53 ****
--- 43,53 ----
  #include "m/m-sparc.h"
  
+ /* Include here a s- file that describes the system type you are using.
+    See the file ../etc/MACHINES for a list of systems and the names of
+    the s- files to use for them.  See s-template.h for documentation on 
+    writing s- files.
+  */
+ #include "s/s-solaris2.h"
+ 
  /* Load in the conversion definitions if this system
     needs them and the source file being compiled has not
***************
*** 116,122 ****
--- 116,124 ----
     on a NeXT (or possibly MACH in general) comment out the next four lines.
   */
+ 
  #ifdef SYSTEM_MALLOC
  #undef SYSTEM_MALLOC
  #endif
+ /* #define SYSTEM_MALLOC */
  #define GNU_MALLOC
  
***************
*** 184,188 ****
     you might want to add "-L/..." or something similar.  */
  
! /* #define LD_SWITCH_SITE -L/x11r4/usr.`arch`/lib */
  
  /* Define C_SWITCH_SITE to contain any special flags your compiler may
--- 186,190 ----
     you might want to add "-L/..." or something similar.  */
  
! #define LD_SWITCH_SITE 
  
  /* Define C_SWITCH_SITE to contain any special flags your compiler may
***************
*** 191,195 ****
     own, you might want to add "-I/..." or something similar.  */
  
! /* #define C_SWITCH_SITE -I/cadillacgnu/gcc-include -I/x11r4/usr/include */
  
  #ifdef USE_GCC
--- 193,197 ----
     own, you might want to add "-I/..." or something similar.  */
  
! #define C_SWITCH_SITE 
  
  #ifdef USE_GCC
***************
*** 202,206 ****
  #endif /* USE_GCC */
  
- 
  /* If you are using SunOS 4.1.1 and X11r5, then you need this patch.
     There is a stupid bug in the SunOS libc.a: two functions which X11r5
--- 204,207 ----
***************
*** 216,220 ****
     sometimes reference memory past the end of the string, which can segv.
   */
! #ifdef sparc
  #define OBJECTS_SYSTEM sunOS-fix.o strcmp.o strcpy.o
  #endif
--- 217,221 ----
     sometimes reference memory past the end of the string, which can segv.
   */
! #if defined(sparc) && !defined(SOLARIS2)
  #define OBJECTS_SYSTEM sunOS-fix.o strcmp.o strcpy.o
  #endif

diff -c -N -p -r src/dispnew.c src/dispnew.c
*** src/dispnew.c	Sat Aug 29 22:36:36 1992
--- src/dispnew.c	Mon Sep 14 14:25:22 1992
*************** For types not defined in VMS, use  defin
*** 2301,2308 ****
    }	
  #endif
  
-   term_init (terminal_type);
- 
  #ifndef MULTI_SCREEN
    highlight_face.hilited = 1;
    if (term_does_underline)
--- 2301,2306 ----
*************** For types not defined in VMS, use  defin
*** 2333,2340 ****
  
        /* Don't handle SIGWINCH if using X.  */
        return;
!     }
  #endif /* HAVE_X_WINDOWS */
  
  #ifdef SIGWINCH
  #ifndef CANNOT_DUMP
--- 2331,2339 ----
  
        /* Don't handle SIGWINCH if using X.  */
        return;
!     } else
  #endif /* HAVE_X_WINDOWS */
+   term_init (terminal_type);
  
  #ifdef SIGWINCH
  #ifndef CANNOT_DUMP
diff -c -N -p -r src/emacs.c src/emacs.c
*** src/emacs.c	Wed Sep  2 03:59:16 1992
--- src/emacs.c	Fri Sep 11 01:04:58 1992
*************** char *stack_bottom;
*** 82,87 ****
--- 82,94 ----
  extern Lisp_Object Vwindow_system;
  #endif /* HAVE_X_WINDOWS */
  
+ #ifdef USG_SHARED_LIBRARIES
+ /* If nonzero, this is the place to put the end of the writable segment
+    at startup.  */
+  
+ unsigned int bss_end = 0;
+ #endif
+  
  /* Nonzero means running Emacs without interactive terminal.  */
  
  int noninteractive;
*************** main (argc, argv, envp)
*** 481,486 ****
--- 488,498 ----
  #ifdef RUN_TIME_REMAP
    if (initialized)
      run_time_remap (argv[0]);
+ #endif
+  
+ #ifdef USG_SHARED_LIBRARIES
+   if (bss_end)
+     brk (bss_end);
  #endif
  
    clearerr (stdin);
diff -c -N -p -r src/environ.c src/environ.c
*** src/environ.c.~1~	Mon Jun 29 15:26:14 1992
--- src/environ.c	Thu Oct 15 13:36:03 1992
*************** getenv_1 (str, ephemeral)
*** 128,134 ****
  
  char *
  getenv (str)
!      register unsigned char *str;
  {
    return ((char *) getenv_1 (str, 0));
  }
--- 128,134 ----
  
  char *
  getenv (str)
!      register const char *str;
  {
    return ((char *) getenv_1 (str, 0));
  }

diff -c -N -p -r src/fileio.c src/fileio.c
*** src/fileio.c	Sat Aug 29 16:27:55 1992
--- src/fileio.c	Thu Sep 10 23:04:23 1992
*************** the Free Software Foundation, 675 Mass A
*** 22,28 ****
  #include <sys/stat.h>
  #include <pwd.h>
  #include <ctype.h>
- #include <sys/dir.h>
  #include <errno.h>
  #include <sys/param.h>
  
--- 22,27 ----
*************** extern int sys_nerr;
*** 40,45 ****
--- 39,50 ----
  #include "lisp.h"
  #include "buffer.h"
  #include "window.h"
+ 
+ #ifdef USG5_4
+ #include <sys/dirent.h>
+ #else
+ #include <sys/dir.h>
+ #endif
  
  #ifdef VMS
  #include <perror.h>
diff -c -N -p -r src/floatfns.c src/floatfns.c
*** src/floatfns.c	Sat Aug 29 22:09:00 1992
--- src/floatfns.c	Thu Sep 10 23:17:46 1992
*************** Rounds the value toward zero.")
*** 469,475 ****
    return num;
  }
  
! #if defined (BSD) || defined (IRIX) || defined (IRIS) || defined (__hpux) || defined(AIX)
  static void
  float_error (signo)
       int signo;
--- 469,475 ----
    return num;
  }
  
! #if defined (BSD) || defined (IRIX) || defined (IRIS) || defined (__hpux) || defined(AIX) || defined(USG5_4)
  static void
  float_error (signo)
       int signo;
diff -c -N -p -r src/getpagesize.h src/getpagesize.h
*** src/getpagesize.h	Wed Jul 29 19:44:04 1992
--- src/getpagesize.h	Fri Sep 11 00:09:32 1992
*************** static size_t getpagesize() { return( 40
*** 10,15 ****
--- 10,22 ----
  #define HAVE_GETPAGESIZE
  #endif
    
+ #ifdef HAVE_SYSCONF
+ #include <sys/unistd.h>
+ 
+ #define getpagesize() sysconf(_SC_PAGESIZE)
+ 
+ #else
+ 
  #ifndef HAVE_GETPAGESIZE
  
  #include <sys/param.h>
*************** static size_t getpagesize() { return( 40
*** 29,31 ****
--- 36,39 ----
  
  #endif /* not HAVE_GETPAGESIZE */
  
+ #endif /* HAVE_SYSCONF */
diff -c -N -p -r src/gmalloc.c src/gmalloc.c
*** src/gmalloc.c	Wed Sep  2 03:59:17 1992
--- src/gmalloc.c	Mon Sep 14 11:45:45 1992
*************** extern size_t __getpagesize ();
*** 982,987 ****
--- 982,994 ----
  #endif
  #endif
  
+ #ifdef USG5_4
+ #include <sys/unistd.h>
+ 
+ #define __getpagesize() sysconf(_SC_PAGESIZE);
+ 
+ #else
+ 
  #ifdef HAVE_GETPAGESIZE
  #define __getpagesize() getpagesize()
  #else
*************** extern size_t __getpagesize ();
*** 1004,1009 ****
--- 1011,1017 ----
  #endif /* not HAVE_GETPAGESIZE */
  
  #endif
+ #endif /* HAVE_SYSCONF */
  
  static size_t pagesize;
  
diff -c -N -p -r src/lread.c src/lread.c
*** src/lread.c	Fri Sep  4 05:43:35 1992
--- src/lread.c	Thu Sep 10 23:23:12 1992
*************** the Free Software Foundation, 675 Mass A
*** 26,31 ****
--- 26,35 ----
  #include "config.h"
  #include "lisp.h"
  
+ #ifdef USG5_4
+ #include <unistd.h>
+ #endif
+ 
  #ifndef standalone
  #include "buffer.h"
  #include "paths.h"
diff -c -N -p -r src/lwlib/lwlib-Xol.c src/lwlib/lwlib-Xol.c
*** src/lwlib/lwlib-Xol.c	Tue Jul  7 18:30:05 1992
--- src/lwlib/lwlib-Xol.c	Mon Oct 12 10:56:50 1992
*************** make_menu_in_widget (widget_instance* in
*** 157,163 ****
        XtSetArg (al [ac], XtNuserData, instance); ac++;
        XtSetArg (al [ac], XtNacceleratorText, cur->key); ac++;
        
!       label = (char *) resource_string (widget, cur->name);
        if (label)
  	{
  	  XtSetArg (al [ac], XtNlabel, label); ac++;
--- 157,165 ----
        XtSetArg (al [ac], XtNuserData, instance); ac++;
        XtSetArg (al [ac], XtNacceleratorText, cur->key); ac++;
        
!       label = cur->name;
! 
!       label = NULL;
        if (label)
  	{
  	  XtSetArg (al [ac], XtNlabel, label); ac++;
*************** xol_update_one_value (widget_instance* i
*** 297,303 ****
  }
  
  void
! xlw_pop_instance (widget_instance* instance, Boolean up)
  {
  }
  
--- 299,305 ----
  }
  
  void
! xol_pop_instance (widget_instance* instance, Boolean up)
  {
  }
  
diff -c -N -p -r src/lwlib/lwlib-Xol.h src/lwlib/lwlib-Xol.h
*** src/lwlib/lwlib-Xol.h	Tue Jul  7 18:30:06 1992
--- src/lwlib/lwlib-Xol.h	Mon Sep 14 13:45:04 1992
***************
*** 4,10 ****
  #include "lwlib-internal.h"
  
  extern widget_creation_entry xol_creation_table [];
! extern widget_creation_function xol_create_dialog;
  
  Boolean
  lw_olit_widget_p (Widget widget);
--- 4,10 ----
  #include "lwlib-internal.h"
  
  extern widget_creation_entry xol_creation_table [];
! extern Widget xol_create_dialog(widget_instance*);
  
  Boolean
  lw_olit_widget_p (Widget widget);
diff -c -N -p -r src/s/s-solaris2.h src/s/s-solaris2.h
*** src/s/s-solaris2.h	Thu Oct 15 13:14:11 1992
--- src/s/s-solaris2.h	Thu Oct 15 13:28:28 1992
***************
*** 0 ****
--- 1,71 ----
+ /* Definitions file for GNU Emacs running on AT&T's System V Release 4
+    Copyright (C) 1987, 1990 Free Software Foundation, Inc.
+ 
+ This file is part of GNU Emacs.
+ 
+ GNU Emacs is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ 
+ GNU Emacs is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU Emacs; see the file COPYING.  If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+ 
+ /* 
+  * For Solaris2 by John Furlani, Sun Microsystems Computer Corporation 
+  *            <john.furlani@East.Sun.COM> 
+  */
+ 
+ /* Use basic SVR4 config for starters */
+ #include "s-usg5-4.h"
+ 
+ /* For Solaris2 specific stuff*/
+ #define SOLARIS2
+ 
+ /* Solaris2 is not BSD */
+ #undef BSD
+ 
+ /* Solaris2 is cool with subprocesses and TIOCGETC */
+ #define subprocesses
+ #undef	BROKEN_TIOCGETC
+ 
+ /* We've got sockets, so we'll use them */
+ #define HAVE_SOCKETS
+ 
+ /* Solaris2 can use SIGPOLL as SIGIO  */
+ #define SIGIO SIGPOLL
+ 
+ /* Flags for OpenWindows */
+ #if 1
+ #undef LD_SWITCH_SYSTEM
+ #define LD_SWITCH_SYSTEM -L/usr/openwin/lib
+ #undef C_SWITCH_SYSTEM
+ #define C_SWITCH_SYSTEM -I/usr/openwin/include
+ #endif 
+ 
+ /* Don't need any of the start files */
+ #undef START_FILES
+ #define START_FILES
+ 
+ #undef LIB_STANDARD
+ #define LIB_STANDARD -lkvm -lsocket -lnsl -lelf -lintl -ldl
+ 
+ /* DATA_SEG_BITS not needed */
+ #undef DATA_SEG_BITS
+ 
+ /* TIOCSIGSEND is ok for Solaris2 */
+ #undef TIOCSIGSEND
+ 
+ /* Xos.h doesn't define __TIMEVAL__ correctly */
+ #define __TIMEVAL__
+ 
+ /* GCC won't see the NSIG definition in sys/signal.h.  */
+ #ifdef __GNUC__
+ #define NSIG 34
+ #endif
diff -c -N -p -r src/s/s-usg5-4.h src/s/s-usg5-4.h
*** src/s/s-usg5-4.h
--- src/s/s-usg5-4.h	Tue Sep 15 22:25:53 1992
***************
*** 0 ****
--- 1,163 ----
+ /* Definitions file for GNU Emacs running on AT&T's System V Release 4
+    Copyright (C) 1987, 1990 Free Software Foundation, Inc.
+ 
+ This file is part of GNU Emacs.
+ 
+ GNU Emacs is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ 
+ GNU Emacs is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU Emacs; see the file COPYING.  If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+ 
+ /* This file written by James Van Artsdalen of Dell Computer Corporation.
+  * james@bigtex.cactus.org.
+  */
+ 
+ /* Use the SysVr3 file for at least base configuration. */
+ 
+ #include "s-usg5-3.h"
+ 
+ #define USG5_4
+ 
+ /* We do have multiple jobs.  Handle ^Z. */
+ 
+ #undef NOMULTIPLEJOBS
+ 
+ #define START_FILES pre-crt0.o /usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o
+ 
+ #define LIB_STANDARD -lsocket -lnsl -lelf -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o
+ 
+ /* No <sioctl.h> */
+ 
+ #define NO_SIOCTL_H
+ 
+ /* Undump with ELF */
+ 
+ #undef COFF
+ 
+ #define UNEXEC unexelf.o
+ 
+ /* Get FIONREAD from <sys/filio.h>.  Get <sys/ttold.h> to get struct
+  * tchars. But get <termio.h> first to make sure ttold.h doesn't
+  * interfere.  And don't try to use SIGIO yet.
+  */
+ 
+ #ifdef emacs
+ #include <sys/filio.h>
+ #include <termio.h>
+ #include <sys/ttold.h>
+ #include <signal.h>
+ #include <sys/wait.h>
+ #include <sys/stream.h>
+ #include <sys/stropts.h>
+ #include <sys/termios.h>
+ #undef SIGIO
+ #endif
+ 
+ /* libc has this stuff, but not utimes. */
+ 
+ #define HAVE_RENAME
+ #define HAVE_SELECT
+ #define HAVE_TIMEVAL
+ #define HAVE_CLOSEDIR
+ #define HAVE_GETTIMEOFDAY
+ #define HAVE_DUP2
+ 
+ #define USE_UTIME
+ 
+ /* <sys/stat.h> *defines* stat(2) as a static function.  If "static"
+  * is blank, then many files will have a public definition for stat(2).
+  */
+ 
+ #undef static
+ 
+ /* We need bss_end from emacs.c for undumping */
+ 
+ #ifndef USG_SHARED_LIBRARIES
+ #define USG_SHARED_LIBRARIES
+ #endif
+ 
+ /* We can support this */
+ 
+ #define CLASH_DETECTION
+ 
+ #define HAVE_PTYS
+ #define HAVE_SETSID
+ #define HAVE_TCATTR
+ 
+ /* It is possible to receive SIGCHLD when there are no children
+    waiting, because a previous waitsys(2) cleaned up the carcass of child
+    without clearing the SIGCHLD pending info.  So, use a non-blocking
+    wait3 instead, which maps to waitpid(2) in SysVr4. */
+ 
+ #define HAVE_WAIT_HEADER
+ #define WAITTYPE int
+ #define wait3(status, options, rusage) \
+   waitpid((pid_t) -1, (status), (options))
+ #define WRETCODE(w) (w >> 8)
+ 
+ /* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
+    subprocesses the usual way.  But TIOCSIGNAL does work for PTYs, and
+    this is all we need.  */
+ 
+ #define TIOCSIGSEND TIOCSIGNAL
+ 
+ /* This change means that we don't loop through allocate_pty too many
+    times in the (rare) event of a failure. */
+ 
+ #undef FIRST_PTY_LETTER
+ #define FIRST_PTY_LETTER 'z'
+ 
+ /* This sets the name of the master side of the PTY. */
+ 
+ #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
+ 
+ /* This sets the name of the slave side of the PTY.  On SysVr4,
+    grantpt(3) forks a subprocess, so keep sigchld_handler() from
+    intercepting that death.  If any child but grantpt's should die
+    within, it should be caught after sigrelse(2). */
+ 
+ #define PTY_TTY_NAME_SPRINTF			\
+   {						\
+     char *ptsname(), *ptyname;			\
+     int trc;					\
+ 						\
+     pty_name[0] = '\0';				\
+     sighold(SIGCLD);				\
+     trc = grantpt(fd);				\
+     sigrelse(SIGCLD);				\
+     if (trc == -1)				\
+       error("could not grant slave pty");	\
+     else if (unlockpt(fd) == -1)		\
+       error("could not unlock slave pty");	\
+     else if (!(ptyname = ptsname(fd)))		\
+       error ("could not enable slave pty");	\
+     else {					\
+       strncpy(pty_name, ptyname, sizeof(pty_name)); \
+       pty_name[sizeof(pty_name) - 1] = 0;	\
+     }						\
+   }
+ 
+ /* Push various streams modules onto a PTY channel. */
+ #define SETUP_SLAVE_PTY \
+   if (ioctl (xforkin, I_PUSH, "ptem") == -1)	\
+     fatal ("ioctl I_PUSH ptem", errno);		\
+   if (ioctl (xforkin, I_PUSH, "ldterm") == -1)	\
+     fatal ("ioctl I_PUSH ldterm", errno);	\
+   if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
+     fatal ("ioctl I_PUSH ttcompat", errno);
+ 
+ /* The definition of this in s-usg5-3.h is not needed in 5.4.  */
+ 
+ #undef LIBX10_SYSTEM
+ #undef LIBX11_SYSTEM
+ 
+ /* ??? For next release, suggest adding HAVE_SOCKETS */
diff -c -N -p -r src/sysdep.c src/sysdep.c
*** src/sysdep.c	Sat Aug 29 16:28:15 1992
--- src/sysdep.c	Fri Sep 18 14:28:18 1992
*************** extern char *sys_errlist[];
*** 91,96 ****
--- 91,101 ----
  #endif
  #ifdef USG
  #include <fcntl.h>
+ #ifdef USG5_4
+ #undef FASYNC
+ #include <sys/file.h>
+ #include <sys/filio.h>
+ #endif /* USG5_4 */
  #endif
  #endif /* not 4.1 bsd */
  
*************** reset_sigio ()
*** 813,819 ****
  
  request_sigio ()
  {
! #ifdef SIGWINCH
    sigunblock (sigmask (SIGWINCH));
  #endif
  #ifdef HAVE_X_WINDOWS
--- 818,824 ----
  
  request_sigio ()
  {
! #if defined(SIGWINCH) && defined(SIGIO) && !defined(titan) && !defined(USG5_4)
    sigunblock (sigmask (SIGWINCH));
  #endif
  #ifdef HAVE_X_WINDOWS
*************** request_sigio ()
*** 828,834 ****
  
  unrequest_sigio ()
  {
! #ifdef SIGWINCH
    sigblock (sigmask (SIGWINCH));
  #endif
  #ifdef HAVE_X_WINDOWS
--- 833,839 ----
  
  unrequest_sigio ()
  {
! #if defined(SIGWINCH) && defined(SIGIO) && !defined(titan) && !defined(USG5_4)
    sigblock (sigmask (SIGWINCH));
  #endif
  #ifdef HAVE_X_WINDOWS
*************** unrequest_sigio ()
*** 842,848 ****
  }
  
  #else /* no FASYNC */
! #ifdef STRIDE		/* Stride doesn't have FASYNC - use FIOASYNC */
  
  request_sigio ()
  {
--- 847,853 ----
  }
  
  #else /* no FASYNC */
! #if defined(STRIDE)	/* Stride doesn't have FASYNC - use FIOASYNC */
  
  request_sigio ()
  {
*************** start_of_data ()
*** 1656,1663 ****
--- 1661,1673 ----
  #ifdef DATA_START
    return ((char *) DATA_START);
  #else
+ #ifdef USG5_4
+   extern etext;
+   return &etext;
+ #else
    extern int data_start;
    return ((char *) &data_start);
+ #endif
  #endif
  }
  #endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */
diff -c -N -p -r src/unexelf.c src/unexelf.c
*** src/unexelf.c	Mon Jun 29 18:27:09 1992
--- src/unexelf.c	Fri Sep 11 01:01:57 1992
*************** In other words, you are welcome to use, 
*** 18,23 ****
--- 18,32 ----
  You are forbidden to forbid anyone else to use, share and improve
  what you give them.   Help stamp out software-hoarding!  */
  
+ /*
+  * $Revision: 1.2 $
+  * $Source: /import/kaplan/stable/distrib/epoch-4.0p2/src/RCS/unexelf.c,v $
+  * $Author: love $
+  * $Date: 92/02/21 16:46:31 $
+  */
+ #ifndef LINT
+ static char rcsid[] = "$Author: love $ $Date: 92/02/21 16:46:31 $ $Source: /import/kaplan/stable/distrib/epoch-4.0p2/src/RCS/unexelf.c,v $ $Revision: 1.2 $";
+ #endif
  
  /*
   * unexec.c - Convert a running program into an a.out file.
*************** extern void fatal(char *, ...);
*** 347,352 ****
--- 356,373 ----
  
  typedef unsigned char byte;
  
+ /* Round X up to a multiple of Y.  */
+ 
+ int
+ round_up (x, y)
+      int x, y;
+ {
+   int rem = x % y;
+   if (rem == 0)
+     return x;
+   return x - rem + y;
+ }
+ 
  /* ****************************************************************
   * unexec
   *
*************** unexec (new_name, old_name, data_start, 
*** 361,371 ****
       char *new_name, *old_name;
       unsigned data_start, bss_start, entry_address;
  {
- /*
-   Made this local -- couldn't find the actual definition -- DAE 
    extern unsigned int bss_end;
- */
-   unsigned int bss_end;
    int new_file, old_file, new_file_size;
  
    /* Pointers to the base of the image of the two files. */
--- 382,388 ----
*************** unexec (new_name, old_name, data_start, 
*** 421,428 ****
     * data2 and bss sections.
     */
  
!   for (old_bss_index = 1; old_bss_index < (int) old_file_h->e_shnum; 
!        old_bss_index++)                    /* added cast -- DAE */
      {
  #ifdef DEBUG
        fprintf (stderr, "Looking for .bss - found %s\n",
--- 438,444 ----
     * data2 and bss sections.
     */
  
!   for (old_bss_index = 1; old_bss_index < old_file_h->e_shnum; old_bss_index++)
      {
  #ifdef DEBUG
        fprintf (stderr, "Looking for .bss - found %s\n",
*************** unexec (new_name, old_name, data_start, 
*** 519,530 ****
  
    for (n = new_file_h->e_phnum - 1; n >= 0; n--)
      {
        if (NEW_PROGRAM_H(n).p_vaddr + NEW_PROGRAM_H(n).p_filesz > old_bss_addr)
  	fatal ("Program segment above .bss in %s\n", old_name, 0);
  
        if (NEW_PROGRAM_H(n).p_type == PT_LOAD
! 	  && (NEW_PROGRAM_H(n).p_vaddr + NEW_PROGRAM_H(n).p_filesz
! 	      == old_bss_addr))
  	break;
      }
    if (n < 0)
--- 535,553 ----
  
    for (n = new_file_h->e_phnum - 1; n >= 0; n--)
      {
+       /* Compute maximum of all requirements for alignment of section.  */
+       int alignment = (NEW_PROGRAM_H (n)).p_align;
+       if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment)
+ 	alignment = OLD_SECTION_H (old_bss_index).sh_addralign;
+ 
        if (NEW_PROGRAM_H(n).p_vaddr + NEW_PROGRAM_H(n).p_filesz > old_bss_addr)
  	fatal ("Program segment above .bss in %s\n", old_name, 0);
  
        if (NEW_PROGRAM_H(n).p_type == PT_LOAD
! 	  && (round_up ((NEW_PROGRAM_H (n)).p_vaddr
! 			+ (NEW_PROGRAM_H (n)).p_filesz,
! 			alignment)
! 	      == round_up (old_bss_addr, alignment)))
  	break;
      }
    if (n < 0)
*************** unexec (new_name, old_name, data_start, 
*** 552,558 ****
     * .data header and modifying the offset, address and size.
     */
  
!   for (n = 1; n < (int) new_file_h->e_shnum; n++)    /* added cast -- DAE */
      {
        if (NEW_SECTION_H(n).sh_offset >= new_data2_offset)
  	NEW_SECTION_H(n).sh_offset += new_data2_size;
--- 575,581 ----
     * .data header and modifying the offset, address and size.
     */
  
!   for (n = 1; n < new_file_h->e_shnum; n++)
      {
        if (NEW_SECTION_H(n).sh_offset >= new_data2_offset)
  	NEW_SECTION_H(n).sh_offset += new_data2_size;
*************** unexec (new_name, old_name, data_start, 
*** 564,571 ****
  
    new_data2_index = old_file_h->e_shnum;
  
!   for (old_data_index = 1; old_data_index < (int) old_file_h->e_shnum;
!        old_data_index++)                    /* added cast -- DAE */
      if (!strcmp (old_section_names + OLD_SECTION_H(old_data_index).sh_name,
  		 ".data"))
        break;
--- 587,594 ----
  
    new_data2_index = old_file_h->e_shnum;
  
!   for (old_data_index = 1; old_data_index < old_file_h->e_shnum;
!        old_data_index++)
      if (!strcmp (old_section_names + OLD_SECTION_H(old_data_index).sh_name,
  		 ".data"))
        break;
diff -c -N -p -r src/x11term.h src/x11term.h
*** src/x11term.h	Mon Jun 29 18:26:43 1992
--- src/x11term.h	Mon Sep 14 10:53:09 1992
***************
*** 13,18 ****
--- 13,22 ----
  
  #define BLOCK_INPUT_DECLARE() int BLOCK_INPUT_mask
  #ifdef SIGIO
+ #ifdef USG5_4
+ #define BLOCK_INPUT()   sighold(SIGIO)
+ #define UNBLOCK_INPUT() sigrelse(SIGIO)
+ #else
  #define BLOCK_INPUT() BLOCK_INPUT_mask = sigblock (sigmask (SIGIO))
  #define UNBLOCK_INPUT() sigsetmask (BLOCK_INPUT_mask)
  #else /* not SIGIO */
*** src/ymakefile.~1~	Fri Sep  4 02:43:45 1992
--- src/ymakefile	Thu Oct 15 13:44:10 1992
***************
*** 149,153 ****
  #else
  #if defined(__GNUC__) && __GNUC__ >= 2
! LD=gcc -nostdlib
  #undef LIB_GCC
  #define LIB_GCC -lgcc
--- 149,153 ----
  #else
  #if defined(__GNUC__) && __GNUC__ >= 2
! LD=$(CC)
  #undef LIB_GCC
  #define LIB_GCC -lgcc


-- cut --
--
Brendan Kehoe                                               brendan@cygnus.com
Cygnus Support, Palo Alto, CA                                  +1 415 322 3811
                                                 Re-elect Clinton/Gore in '96!