Via: uk.ac.oxford.prg; Fri, 4 Sep 1992 10:41:23 +0100
Date: Fri, 4 Sep 92 10:41:01 BST
From: rpb@psy.oxford.ac.uk (Ray Bellis)
Original-To: gopher-news@boombox.micro.umn.edu
Subject: Patches to Gopher 1.03 for DEC OSF/1
Newsgroups: comp.infosystems.gopher
Distribution: comp


Here are the patches I had to apply to get gopher 1.03 working on my
DEC OSF/1 v1.0 system.  Most of the patches were neccesary because OSF/1
is a Posix system.

Some other patches are to tidy up the Makefiles, since not all systems
can use straight `install' [OSF/1 needs `installbsd'].

With these patches, the sources compile with just two warnings in the
client directory.  Please note though, the client seems to work, but I
haven't tested the server under OSF/1 since my server is a Sun.

-----------------------------------------------------------------------
diff -cr ../gopher1.03/Makefile.config ./Makefile.config
*** ../gopher1.03/Makefile.config	Wed Sep  2 21:14:49 1992
--- ./Makefile.config	Fri Sep  4 10:20:55 1992
***************
*** 23,35 ****
  
  RANLIB = ranlib
  
  
  #-------------------------------------------------
  # Where shall we install stuff?
  #
  
  CLIENTDIR	= /usr/local/bin
! CLIENTLIB       = /usr/local/lib/
  SERVERDIR	= /usr/local/etc
  MAN1DIR		= /usr/local/man/man1
  MAN8DIR		= /usr/local/man/man8
--- 23,40 ----
  
  RANLIB = ranlib
  
+ #-------------------------------------------------
+ # The install command on your system.  OSF/1 should change this
+ # to "installbsd"
  
+ INSTALL		= installbsd
+ 
  #-------------------------------------------------
  # Where shall we install stuff?
  #
  
  CLIENTDIR	= /usr/local/bin
! CLIENTLIB       = /usr/local/lib
  SERVERDIR	= /usr/local/etc
  MAN1DIR		= /usr/local/man/man1
  MAN8DIR		= /usr/local/man/man8
diff -cr ../gopher1.03/doc/Makefile ./doc/Makefile
*** ../gopher1.03/doc/Makefile	Fri May  1 20:19:00 1992
--- ./doc/Makefile	Fri Sep  4 10:22:54 1992
***************
*** 1,8 ****
  include ../Makefile.config
  
  install:
! 	install -c gopherd.8 $(MAN8DIR)
! 	install -c gopher.1 $(MAN1DIR)
  
  clean:
  	-rm -f *~
--- 1,8 ----
  include ../Makefile.config
  
  install:
! 	$(INSTALL) -c gopherd.8 $(MAN8DIR)
! 	$(INSTALL) -c gopher.1 $(MAN1DIR)
  
  clean:
  	-rm -f *~
diff -cr ../gopher1.03/gopher/Makefile ./gopher/Makefile
*** ../gopher1.03/gopher/Makefile	Wed Sep  2 21:10:53 1992
--- ./gopher/Makefile	Fri Sep  4 10:21:54 1992
***************
*** 22,29 ****
  	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(CLIENTLIBS) 
  
  install : all
! 	install -c $(TARGET) $(CLIENTDIR)
! 	install -c gopher.hlp $(CLIENTLIB)
  
  clean:
  	-rm -f $(TARGET) $(OBJS) *.out *~ core
--- 22,29 ----
  	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(CLIENTLIBS) 
  
  install : all
! 	$(INSTALL) -c $(TARGET) $(CLIENTDIR)
! 	$(INSTALL) -c gopher.hlp $(CLIENTLIB)
  
  clean:
  	-rm -f $(TARGET) $(OBJS) *.out *~ core
diff -cr ../gopher1.03/gopher/subprocs.c ./gopher/subprocs.c
*** ../gopher1.03/gopher/subprocs.c	Wed Jun 24 19:01:29 1992
--- ./gopher/subprocs.c	Fri Sep  4 09:43:07 1992
***************
*** 24,30 ****
        */
  
       int pid;
! #ifdef POSIXWAIT
       int status;
  
       while ( (pid =waitpid(-1, &status, WNOHANG)) > 0)
--- 24,30 ----
        */
  
       int pid;
! #if defined(POSIXWAIT) || defined(_POSIX_SOURCE)
       int status;
  
       while ( (pid =waitpid(-1, &status, WNOHANG)) > 0)
diff -cr ../gopher1.03/gopherd/Dirent.h ./gopherd/Dirent.h
*** ../gopher1.03/gopherd/Dirent.h	Wed Aug 19 23:23:04 1992
--- ./gopherd/Dirent.h	Fri Sep  4 09:58:05 1992
***************
*** 9,15 ****
  /*** These can use dirent for sure ***/
  
  #else
! #  if  defined(sun) || defined(ultrix) || defined(hpux) || defined(__sgi) ||          defined(_AIX) || defined(_SYSV_SOURCE) || defined(sgi) || defined(cray)
  #      include <dirent.h>
  
  /*** Everyone else gets dir.h, plus some funky definitions ***/
--- 9,16 ----
  /*** These can use dirent for sure ***/
  
  #else
! #  if  defined(sun) || defined(ultrix) || defined(hpux) || defined(__sgi) ||          defined(_AIX) || defined(_SYSV_SOURCE) || defined(sgi) || defined(cray) || defined(_POSIX_SOURCE)
! 	
  #      include <dirent.h>
  
  /*** Everyone else gets dir.h, plus some funky definitions ***/
diff -cr ../gopher1.03/gopherd/Makefile ./gopherd/Makefile
*** ../gopher1.03/gopherd/Makefile	Wed Sep  2 21:15:08 1992
--- ./gopherd/Makefile	Fri Sep  4 10:21:32 1992
***************
*** 115,121 ****
  	$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(DLOBJS) $(LIBS)
  
  install : all
! 	install -c $(TARGET) $(SERVERDIR)
  	-rm	$(SERVERDIR)/gopherls $(SERVERDIR)/gindexd
  	-ln     -s $(SERVERDIR)/$(TARGET) $(SERVERDIR)/gopherls
  	-ln     -s $(SERVERDIR)/$(TARGET) $(SERVERDIR)/gindexd
--- 115,121 ----
  	$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(DLOBJS) $(LIBS)
  
  install : all
! 	$(INSTALL) -c $(TARGET) $(SERVERDIR)
  	-rm	$(SERVERDIR)/gopherls $(SERVERDIR)/gindexd
  	-ln     -s $(SERVERDIR)/$(TARGET) $(SERVERDIR)/gopherls
  	-ln     -s $(SERVERDIR)/$(TARGET) $(SERVERDIR)/gindexd
diff -cr ../gopher1.03/gopherd/daemon.c ./gopherd/daemon.c
*** ../gopher1.03/gopherd/daemon.c	Fri Aug 28 23:42:41 1992
--- ./gopherd/daemon.c	Fri Sep  4 10:08:57 1992
***************
*** 44,55 ****
        */
  
       int pid;
       union wait  status;
  
       while ( (pid = wait3(&status, WNOHANG, (struct rusage *) 0)) > 0)
! 	  ;
  }
- 
  
  #include <stdio.h>
  #include <sys/param.h>
--- 44,62 ----
        */
  
       int pid;
+ #if defined(POSIXWAIT) || defined(_POSIX_SOURCE)
+      int status;
+ 
+      while ( (pid =waitpid(-1, &status, WNOHANG)) > 0)
+ 	  ;
+ #else
+ 
       union wait  status;
  
       while ( (pid = wait3(&status, WNOHANG, (struct rusage *) 0)) > 0)
!           ;
! #endif
  }
  
  #include <stdio.h>
  #include <sys/param.h>
diff -cr ../gopher1.03/object/GSgopherobj.c ./object/GSgopherobj.c
*** ../gopher1.03/object/GSgopherobj.c	Tue Aug 25 20:34:48 1992
--- ./object/GSgopherobj.c	Fri Sep  4 09:23:18 1992
***************
*** 3,9 ****
   */
  #include "GSgopherobj.h"
  
! #if defined(mips)   /*** Gross hack, yuck! ***/
  #define _SIZE_T
  #endif
  
--- 3,9 ----
   */
  #include "GSgopherobj.h"
  
! #if defined(mips) && defined(ultrix)   /*** Gross hack, yuck! ***/
  #define _SIZE_T
  #endif
  
------------------------------------------------------------------------------
R. P. Bellis				E-Mail:	<rpb@psy.ox.ac.uk>
Dept. of Experimental Psychology	Whois:	(RB83)
University of Oxford			Tel:	+44 865 271419
South Parks Road			Fax:	+44 865 310447
Oxford OX1 3UD
------------------------------------------------------------------------------