[91] in Zephyr Mailing List

home help back first fref pref prev next nref lref last post

Zephyr source patches for 8.31.92 snapshot

daemon@ATHENA.MIT.EDU (Stephen Gildea)
Thu May 27 12:09:08 1993

To: Zephyr@Athena.MIT.EDU
In-Reply-To: Message from lucien@watson.ibm.com of 26 May 93 11:59:46 EDT<9305261559.AA23239@fionavar.watson.ibm.com> 
Date: Thu, 27 May 1993 12:05:56 EDT
From: Stephen Gildea <gildea@expo.lcs.mit.edu>

I retrieved and built the 31 Aug 92 Zephyr snapshot from
athena-dist.mit.edu and built it on Sparc running SunOS 4.1.3,
DECstations running Ultrix 4.2 and OSF/1, and HP-UX 8.07.
It works great, but I had to do a little work.

I have submitted these suggestions to bug-zephyr, and I hope the
Athena folks will integrate them.  But for those of you who can't wait
until the next release or snapshot, Lucien suggested I share them with
this wider audience.


Based on my experience building Zephyr, here's how I would recommend
building it:

Read J.T.Kohl's Administering Zephyr paper from the older Zephyr distribution.

Edit config/config.Imakefile for your site.
If you have imake (i.e., if you set OTHER_IMAKE in config.Imakefile):
	type "imake -Iconfig" at top level.
Type "make world" at top level.


Summary of my changes to the snapshot:

The rules command_table and make_error_table in config/Imake.rules
should separate running make_commands or compile_et from compiling the
resulting files.  I built zephyr on a platform to which make_commands
and et did not port easily.  So I want to be able to copy the .c and
.h files from another machine and not have the local machine insist on
recreating them.

server/zstring.c should not include mit-copyright.h.
Note that the include of server/mit-copyright.h 10 lines earlier succeeds.

lib/strcasecmp.c needs to include sys/types.h always, not just for
lint, to get u_char defined.

et/lib/internal.h declares perror incorrectly for Ultrix and OSF/1.

ss/lib/list_rqs.c should not declare wait struct if it won't use it.
This makes the code easily portable to machines without "union wait".

zhm/zhm.c assumes the system has the TIOCNOTTY ioctl.  Also assumes
the getdtablesize system call.  I changed it to use getrlimit instead
of getdtablesize, but probably calling the Posix function sysconf
would be better.

zwgc: HP-UX is like AUX in the name (regex) and locations (in libPW)
for its regular expression functions.  I changed a couple of ifdefs.

zwgc/X_driver.c makes two references into the Display structure, which
is illegal.  The Display is an opaque structure, and you are supposed
to use the provided functions to access its members.  In R6, you will
get a compile-time error if you try to dereference a Display.

 < Stephen
   MIT X Consortium


Those fixes again, with diffs:

The rules command_table and make_error_table in config/Imake.rules
should separate running make_commands or compile_et from compiling the
resulting files.  I built zephyr on a platform to which make_commands
and et did not port easily.  So I want to be able to copy the .c and
.h files from another machine and not have the local machine insist on
recreating them.

*** ./config/Imake.rules.dist	Mon Aug 10 09:26:11 1992
--- ./config/Imake.rules	Mon Mar 15 17:25:16 1993
***************
*** 435,441 ****
  #ifdef PROFILED_LIBS
  #define command_table(tbl)						@@\
! concat(tbl,.o): concat(tbl,.ct)						@@\
! 	$(RM) concat(tbl,.c) concat(tbl,.o)				@@\
  	$(MAKE_COMMANDS) concat(tbl,.ct)				@@\
  	$(CC) -c PROF_FLAG $(CFLAGS) concat(tbl,.c)			@@\
  	$(MV) concat(tbl,.o) concat3(profiled/,tbl,.o)			@@\
--- 435,443 ----
  #ifdef PROFILED_LIBS
  #define command_table(tbl)						@@\
! concat(tbl,.c): concat(tbl,.ct)						@@\
! 	$(RM) concat(tbl,.c)						@@\
  	$(MAKE_COMMANDS) concat(tbl,.ct)				@@\
+ concat(tbl,.o): concat(tbl,.c)						@@\
+ 	$(RM) concat(tbl,.o)						@@\
  	$(CC) -c PROF_FLAG $(CFLAGS) concat(tbl,.c)			@@\
  	$(MV) concat(tbl,.o) concat3(profiled/,tbl,.o)			@@\
***************
*** 443,449 ****
  
  #define make_error_table(tbl)						@@\
! concat(tbl,.h) concat(tbl,.o): concat(tbl,.et)				@@\
  	$(RM) concat(tbl,.c) concat(tbl,.h)				@@\
  	$(COMPILE_ET) concat(tbl,.et)					@@\
  	$(CC) -c PROF_FLAG $(CFLAGS) concat(tbl,.c)			@@\
  	$(MV) concat(tbl,.o) concat3(profiled/,tbl,.o)			@@\
--- 445,452 ----
  
  #define make_error_table(tbl)						@@\
! concat(tbl,.h) concat(tbl,.c): concat(tbl,.et)				@@\
  	$(RM) concat(tbl,.c) concat(tbl,.h)				@@\
  	$(COMPILE_ET) concat(tbl,.et)					@@\
+ concat(tbl,.o): concat(tbl,.h) concat(tbl,.c)				@@\
  	$(CC) -c PROF_FLAG $(CFLAGS) concat(tbl,.c)			@@\
  	$(MV) concat(tbl,.o) concat3(profiled/,tbl,.o)			@@\
***************
*** 451,486 ****
  	$(CC) -c $(CFLAGS) concat(tbl,.c)				@@\
  clean::									@@\
! 	$(RM) concat(tbl,.o) concat(tbl,.h)
  
  #else /* !PROFILED_LIBS */
  #define command_table(tbl)						@@\
! concat(tbl,.o): concat(tbl,.ct)						@@\
! 	$(RM) concat(tbl,.c) concat(tbl,.o)				@@\
  	$(MAKE_COMMANDS) concat(tbl,.ct)				@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)
  
  #define make_error_table(tbl)						@@\
! concat(tbl,.h) concat(tbl,.o): concat(tbl,.et)				@@\
  	$(RM) concat(tbl,.c) concat(tbl,.h)				@@\
  	$(COMPILE_ET) concat(tbl,.et)					@@\
  	maybe_compile_ucode($(CC) -j $(CFLAGS) concat(tbl,.c))		@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)				@@\
  clean::									@@\
! 	$(RM) concat(tbl,.o) concat(tbl,.h)
  #endif /* PROFILED_LIBS */
  
  #define command_table_noprof(tbl)					@@\
! concat(tbl,.o) concat(tbl,.c): concat(tbl,.ct)				@@\
! 	$(RM) concat(tbl,.c) concat(tbl,.o)				@@\
  	$(MAKE_COMMANDS) concat(tbl,.ct)				@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)
  #define error_table_noprof(tbl)						@@\
! concat(tbl,.h) concat(tbl,.o): concat(tbl,.et)				@@\
  	$(RM) concat(tbl,.c) concat(tbl,.h)				@@\
  	$(COMPILE_ET) concat(tbl,.et)					@@\
  	maybe_compile_ucode($(CC) -j $(CFLAGS) concat(tbl,.c))		@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)				@@\
  clean::									@@\
! 	$(RM) concat(tbl,.o) concat(tbl,.h)
  
  #define install_shell_scripts(which,targetdir)				@@\
--- 454,495 ----
  	$(CC) -c $(CFLAGS) concat(tbl,.c)				@@\
  clean::									@@\
! 	$(RM) concat(tbl,.o) concat(tbl,.h) concat(tbl,.c)
  
  #else /* !PROFILED_LIBS */
  #define command_table(tbl)						@@\
! concat(tbl,.c): concat(tbl,.ct)						@@\
! 	$(RM) concat(tbl,.c)						@@\
  	$(MAKE_COMMANDS) concat(tbl,.ct)				@@\
+ concat(tbl,.o): concat(tbl,.c)						@@\
+ 	$(RM) concat(tbl,.o)						@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)
  
  #define make_error_table(tbl)						@@\
! concat(tbl,.h) concat(tbl,.c): concat(tbl,.et)				@@\
  	$(RM) concat(tbl,.c) concat(tbl,.h)				@@\
  	$(COMPILE_ET) concat(tbl,.et)					@@\
+ concat(tbl,.o): concat(tbl,.h) concat(tbl,.c)				@@\
  	maybe_compile_ucode($(CC) -j $(CFLAGS) concat(tbl,.c))		@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)				@@\
  clean::									@@\
! 	$(RM) concat(tbl,.o) concat(tbl,.h) concat(tbl,.c)
  #endif /* PROFILED_LIBS */
  
  #define command_table_noprof(tbl)					@@\
! concat(tbl,.c): concat(tbl,.ct)						@@\
! 	$(RM) concat(tbl,.c)						@@\
  	$(MAKE_COMMANDS) concat(tbl,.ct)				@@\
+ concat(tbl,.o): concat(tbl,.c)						@@\
+ 	$(RM) concat(tbl,.o)						@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)
  #define error_table_noprof(tbl)						@@\
! concat(tbl,.h) concat(tbl,.c): concat(tbl,.et)				@@\
  	$(RM) concat(tbl,.c) concat(tbl,.h)				@@\
  	$(COMPILE_ET) concat(tbl,.et)					@@\
+ concat(tbl,.o): concat(tbl,.h) concat(tbl,.c)				@@\
  	maybe_compile_ucode($(CC) -j $(CFLAGS) concat(tbl,.c))		@@\
  	$(CC) -c $(CFLAGS) concat(tbl,.c)				@@\
  clean::									@@\
! 	$(RM) concat(tbl,.o) concat(tbl,.h) concat(tbl,.c)
  
  #define install_shell_scripts(which,targetdir)				@@\


server/zstring.c should not include mit-copyright.h.
Note that the include of server/mit-copyright.h 10 lines earlier succeeds.

*** ./server/zstring.c.dist	Fri Aug 14 08:24:07 1992
--- ./server/zstring.c	Fri Mar 12 18:00:36 1993
***************
*** 21,26 ****
  #endif
  
- #include <mit-copyright.h>
- 
  #include <ctype.h>
  #if defined(__STDC__) && !defined(__HIGHC__) && !defined(SABER)
--- 21,24 ----


lib/strcasecmp.c needs to include sys/types.h always, not just for
lint, to get u_char defined.

*** ./lib/strcasecmp.c.dist	Fri Aug 14 08:25:08 1992
--- ./lib/strcasecmp.c	Fri Mar 12 18:10:09 1993
***************
*** 15,21 ****
  #endif /* LIBC_SCCS and not lint */
  
- #ifdef lint
  #include <sys/types.h>
- #endif
  
  #ifndef __STDC__
--- 15,19 ----



et/lib/internal.h declares perror incorrectly for Ultrix and OSF/1.

*** ./et/lib/internal.h.dist	Thu Oct 19 18:03:08 1989
--- ./et/lib/internal.h	Tue Mar 23 18:24:39 1993
***************
*** 12,16 ****
  extern const int sys_nerr;
  
! #ifdef __STDC__
  void perror (const char *);
  #else
--- 12,17 ----
  extern const int sys_nerr;
  
! /* DEC systems want the ANSI definition but don't claim to be ANSI */
! #if defined(__STDC__) || defined(ultrix) || defined(_AES_SOURCE)
  void perror (const char *);
  #else


ss/lib/list_rqs.c should not declare wait struct if it won't use it.
This makes the code easily portable to machines without "union wait".

*** ./ss/lib/list_rqs.c.dist	Tue May 30 23:09:08 1989
--- ./ss/lib/list_rqs.c	Wed Mar 24 12:29:10 1993
***************
*** 36,40 ****
--- 36,42 ----
      int mask;
      int (*func)();
+ #ifndef NO_FORK
      union wait waitb;
+ #endif
  
      DONT_USE(argc);


zhm/zhm.c assumes the system has the TIOCNOTTY ioctl.  Also assumes
the getdtablesize system call.  I changed it to use getrlimit instead
of getdtablesize, but probably calling the Posix function sysconf
would be better.

*** ./zhm/zhm.c.dist	Sun Dec  1 14:37:22 1991
--- ./zhm/zhm.c	Wed Mar 24 15:40:31 1993
***************
*** 396,403 ****
  }
  
  void detach()
  {
       /* detach from terminal and fork. */
!      register int i, x = ZGetFD(), size = getdtablesize();
    
       if (i = fork()) {
--- 396,411 ----
  }
  
+ #ifdef hpux
+ #include <sys/resource.h>
+ #endif
+ 
  void detach()
  {
       /* detach from terminal and fork. */
!      register int i, x = ZGetFD();
!      register int size;
! #ifdef hpux
!      struct rlimit file_limit;
! #endif
    
       if (i = fork()) {
***************
*** 407,410 ****
--- 415,425 ----
       }
  
+ #ifdef hpux
+      i = getrlimit(RLIMIT_NOFILE, &file_limit);
+      size = i == 0 ? file_limit.rlim_cur : 0;
+ #else
+      size = getdtablesize();
+ #endif
+ 
       for (i = 0; i < size; i++)
  	  if (i != x)
***************
*** 411,414 ****
--- 426,430 ----
  	       (void) close(i);
    
+ #ifdef TIOCNOTTY
       if ((i = open("/dev/tty", O_RDWR, 666)) < 0)
  	  ;		/* Can't open tty, but don't flame about it. */
***************
*** 417,420 ****
--- 433,437 ----
  	  (void) close(i);
       }
+ #endif
  }
  


zwgc: HP-UX is like AUX in the name (regex) and locations (in libPW)
for its regular expression functions.  I changed a couple of ifdefs.

*** ./zwgc/Imakefile.dist	Fri Aug  7 11:18:02 1992
--- ./zwgc/Imakefile	Wed Mar 24 15:04:07 1993
***************
*** 10,14 ****
  
  SUBDIRS= Memory String Dictionary
! #ifdef macII
  LIBS2= -lc -lPW
  #endif
--- 10,14 ----
  
  SUBDIRS= Memory String Dictionary
! #if defined(macII) || defined(PWB)
  LIBS2= -lc -lPW
  #endif
*** ./zwgc/regexp.c.dist	Thu Jun 20 09:20:49 1991
--- ./zwgc/regexp.c	Wed Mar 24 15:02:14 1993
***************
*** 44,52 ****
  
  /*
!  * This is for AUX.
   * It is a wrapper around the C library regexp functions.
   */
  
! #ifdef _AUX_SOURCE
  
  static char *re;
--- 44,52 ----
  
  /*
!  * This is for AUX and HP-UX.
   * It is a wrapper around the C library regexp functions.
   */
  
! #if defined(_AUX_SOURCE) || defined(PWB)
  
  static char *re;


zwgc/X_driver.c makes two references into the Display structure, which
is illegal.  The Display is an opaque structure, and you are supposed
to use the provided functions to access its members.  In R6, you will
get a compile-time error if you try to dereference a Display.

*** ./zwgc/X_driver.c.dist	Thu May  7 18:38:01 1992
--- ./zwgc/X_driver.c	Wed May 26 10:07:48 1993
***************
*** 275,280 ****
       * Get resources from the just opened display:
       */
!     if (dpy->xdefaults != NULL)
! 	temp_db2 = XrmGetStringDatabase(dpy->xdefaults);
      else
  	temp_db2 = NULL;
--- 275,280 ----
       * Get resources from the just opened display:
       */
!     if (XResourceManagerString(dpy) != NULL)
! 	temp_db2 = XrmGetStringDatabase(XResourceManagerString(dpy));
      else
  	temp_db2 = NULL;
***************
*** 325,329 ****
      extern void finalize_zephyr();
  
!     ERROR2("X IO error on display '%s'--exiting\n", display->display_name);
      finalize_zephyr();
      exit(1);
--- 325,329 ----
      extern void finalize_zephyr();
  
!     ERROR2("X IO error on display '%s'--exiting\n", DisplayString(display));
      finalize_zephyr();
      exit(1);



/end/

home help back first fref pref prev next nref lref last post