From: mitra@pandora.sf.ca.us (Mitra)
Subject: Patch for Gopher1.1 under SCO Unix
Organization: Pandora Systems
Date: Thu, 17 Dec 1992 01:11:28 GMT
X-Newsreader: TIN [version 1.1 PL6]

The new gopher1.1 is great, here is a patch for the fixes I needed
to get it running under SCO Unix (without ODT). A few of the fixes
are just configuration stuff in Makefile.config or conf.h, but most
of them are changes ifdef-ed against a flag I set in the Makefile
(M_SCOUNIX). I hope that someone can intgrate these into the
next release.

To apply the patch, cd to your gopher1.1 directory and run
patch -l -p1 <patchfile

- Mitra
mitra@pandora.sf.ca.us 
Technical Director - Pandora Systems
========================================

diff -c -r -b gopher1.1/Makefile.config gopher1.1+/Makefile.config
*** gopher1.1/Makefile.config	Fri Dec 11 11:03:05 1992
--- gopher1.1+/Makefile.config	Tue Dec 15 12:54:53 1992
***************
*** 66,75 ****
  
  #------------------------------------------------
  # The ranlib command on your system.  A/UX (and probably other sysv's
  # should change this to "touch"
  #
  
! RANLIB = ranlib
  
  #------------------------------------------------
  # The install command on your system.  OSF/1 should change this
--- 66,76 ----
  
  #------------------------------------------------
  # The ranlib command on your system.  A/UX (and probably other sysv's
+ # and SCO UNIX
  # should change this to "touch"
  #
  
! RANLIB = touch
  
  #------------------------------------------------
  # The install command on your system.  OSF/1 should change this
***************
*** 79,85 ****
  # IBM AIX systems should change this to /usr/ucb/install
  #
  
! INSTALL = install
  
  #-------------------------------------------------
  # Where shall we install stuff?
--- 80,86 ----
  # IBM AIX systems should change this to /usr/ucb/install
  #
  
! INSTALL = bsdinst
  
  #-------------------------------------------------
  # Where shall we install stuff?
***************
*** 88,95 ****
  CLIENTDIR	= $(PREFIX)/bin
  CLIENTLIB       = $(PREFIX)/lib/
  SERVERDIR	= $(PREFIX)/etc
! MAN1DIR		= $(PREFIX)/man/man1
! MAN8DIR		= $(PREFIX)/man/man8
  
  
  #-----------------------------------------------------------------
--- 89,96 ----
  CLIENTDIR	= $(PREFIX)/bin
  CLIENTLIB       = $(PREFIX)/lib/
  SERVERDIR	= $(PREFIX)/etc
! MAN1DIR		= /usr/man/man1
! MAN8DIR		= /usr/man/man8
  
  
  #-----------------------------------------------------------------
***************
*** 113,119 ****
  #       admin.viccol.edu.au
  #       pub/dl/describe-1.8.tar.Z  or higher...
  #
! SERVEROPTS	= -DBIO #-DDL # -DLOADRESTRICT
  DLPATH		= /home/mudhoney/lindner/src/describe
  #DLOBJS		= $(DLPATH)/getdesc.o $(DLPATH)/enddesc.o
  
--- 114,120 ----
  #       admin.viccol.edu.au
  #       pub/dl/describe-1.8.tar.Z  or higher...
  #
! SERVEROPTS	= # -DBIO #-DDL # -DLOADRESTRICT
  DLPATH		= /home/mudhoney/lindner/src/describe
  #DLOBJS		= $(DLPATH)/getdesc.o $(DLPATH)/enddesc.o
  
***************
*** 136,142 ****
  #LOADLIBS	= -lkvm
  #SEQLIBS        = -lseq
  #PTXLIBS        = -lseq -lsocket -linet -lnsl
! #SCOLIBS        = -lsocket
  #SVR4LIBS	= -lsocket -L /usr/ucblib -lc -lucb
  
  OTHERLIBS	=  $(HPLIBS) $(UMAXLIBS) $(SEQLIBS) $(PTXLIBS) $(SCOLIBS) \
--- 137,143 ----
  #LOADLIBS	= -lkvm
  #SEQLIBS        = -lseq
  #PTXLIBS        = -lseq -lsocket -linet -lnsl
! SCOLIBS        = -lsocket
  #SVR4LIBS	= -lsocket -L /usr/ucblib -lc -lucb
  
  OTHERLIBS	=  $(HPLIBS) $(UMAXLIBS) $(SEQLIBS) $(PTXLIBS) $(SCOLIBS) \
***************
*** 152,160 ****
  # the domain name a null string.  Otherwise put in the rest of
  # your domain name that `hostname` doesn't return.
  
! DOMAIN		= .micro.umn.edu
  
- 
  #-----------------------------------------------------------------
  # SERVERDIR is the default directory for gopherd.  It can be 
  # overridden on the command line
--- 153,161 ----
  # the domain name a null string.  Otherwise put in the rest of
  # your domain name that `hostname` doesn't return.
  
! #DOMAIN		= .micro.umn.edu
! DOMAIN 		= 
  
  #-----------------------------------------------------------------
  # SERVERDIR is the default directory for gopherd.  It can be 
  # overridden on the command line
***************
*** 180,192 ****
  COMPAT = # -DNOSTRSTR # -DNO_STRDUP # -DNO_BZERO # -DNO_TMPNAM
  
  
  #-----------------------------------------------------------------
  # Stuff that follows shouldn't be changed
  #
  
  OBJINCLUDES 	= -I../object
  OTHERINCLUDES	= -I.. -I../ir -I../ui
! INCLUDES	= $(OBJINCLUDES) $(OTHERINCLUDES)
  
  LDFLAGS		= -L../object
  SHELL		= /bin/sh
--- 181,197 ----
  COMPAT = # -DNOSTRSTR # -DNO_STRDUP # -DNO_BZERO # -DNO_TMPNAM
  
  
+ # This is a horrible place to do this, but better than hacking Makefiles
+ LOCALINCLUDES = -DM_SCOUNIX -UM_XENIX
+ 
  #-----------------------------------------------------------------
  # Stuff that follows shouldn't be changed
+ # Rubbish! You need somewhere to define system and OS dependant flags
  #
  
  OBJINCLUDES 	= -I../object
  OTHERINCLUDES	= -I.. -I../ir -I../ui
! INCLUDES	= $(LOCALINCLUDES) $(OBJINCLUDES) $(OTHERINCLUDES)
  
  LDFLAGS		= -L../object
  SHELL		= /bin/sh
diff -c -r -b gopher1.1/doc/INSTALL gopher1.1+/doc/INSTALL
*** gopher1.1/doc/INSTALL	Thu Dec  3 10:01:09 1992
--- gopher1.1+/doc/INSTALL	Tue Dec 15 12:46:43 1992
***************
*** 73,78 ****
--- 73,79 ----
  
  "make lib"
  "make ir"
+ "make bin"
  
  Or just type make if you want the whole WAIS thing.
  
diff -c -r -b gopher1.1/gopher/gopher.h gopher1.1+/gopher/gopher.h
*** gopher1.1/gopher/gopher.h	Thu Dec 10 15:32:33 1992
--- gopher1.1+/gopher/gopher.h	Tue Dec 15 12:46:49 1992
***************
*** 46,52 ****
  #include <sys/types.h>
  #include <sys/file.h>
  
! #ifdef  M_XENIX         /* SCO Xenix/UNIX */
  #define MAXPATHLEN      FILENAME_MAX
  #include        <sys/stream.h>
  #include        <sys/fcntl.h>
--- 46,52 ----
  #include <sys/types.h>
  #include <sys/file.h>
  
! #if defined(M_XENIX) || defined(M_SCOUNIX)         /* SCO Xenix/UNIX */
  #define MAXPATHLEN      FILENAME_MAX
  #include        <sys/stream.h>
  #include        <sys/fcntl.h>
diff -c -r -b gopher1.1/gopherd/Makefile gopher1.1+/gopherd/Makefile
*** gopher1.1/gopherd/Makefile	Thu Dec 10 15:17:46 1992
--- gopher1.1+/gopherd/Makefile	Tue Dec 15 12:46:51 1992
***************
*** 38,46 ****
  
  NEXTOBJ = NeXTindex.o
  
! WAISGATEOBJ = ../ui/source.o
  
! WAISOBJ = ../bin/inv.a  ../bin/wais.a ../bin/client.a $(WAISGATEOBJ)
  
  CCFLAGS	= $(OPT) -DDATA_DIRECTORY=\"$(SERVERDATA)\" \
  	-DDOMAIN_NAME=\"$(DOMAIN)\" \
--- 38,46 ----
  
  NEXTOBJ = NeXTindex.o
  
! WAISGATEOBJ = ../ui/source.o ../bin/libftw.a
  
! WAISOBJ = ../bin/inv.a  ../bin/client.a ../bin/wais.a $(WAISGATEOBJ)
  
  CCFLAGS	= $(OPT) -DDATA_DIRECTORY=\"$(SERVERDATA)\" \
  	-DDOMAIN_NAME=\"$(DOMAIN)\" \
diff -c -r -b gopher1.1/gopherd/daemon.c gopher1.1+/gopherd/daemon.c
*** gopher1.1/gopherd/daemon.c	Thu Dec 10 15:17:46 1992
--- gopher1.1+/gopherd/daemon.c	Tue Dec 15 13:00:17 1992
***************
*** 69,75 ****
  #include <errno.h>
  extern int errno;
  
! #if defined(SIGTSTP) && !defined(M_XENIX) && !defined(USG)/* True on a BSD system */
  #include <sys/file.h>
  #include <sys/ioctl.h>
  #endif
--- 69,75 ----
  #include <errno.h>
  extern int errno;
  
! #if defined(SIGTSTP) && !defined(M_XENIX) && !defined(USG)  /* True on a BSD system */
  #include <sys/file.h>
  #include <sys/ioctl.h>
  #endif
***************
*** 121,127 ****
  	   * Ensure the process can't reacquire a new controlling terminal
  	   */
  	  
! #if defined(SIGTSTP) && !defined(USG)  /* BSD */
  	  
  #if defined(hpux) || defined(_SEQUENT_) || defined(_CRAY) || defined(USG)
  	  setsid();
--- 121,127 ----
  	   * Ensure the process can't reacquire a new controlling terminal
  	   */
  	  
! #if defined(SIGTSTP) && !defined(USG) && !defined(M_SCOUNIX) /* BSD */
  	  
  #if defined(hpux) || defined(_SEQUENT_) || defined(_CRAY) || defined(USG)
  	  setsid();
diff -c -r -b gopher1.1/mindexd/daemon.c gopher1.1+/mindexd/daemon.c
*** gopher1.1/mindexd/daemon.c	Thu Apr  9 15:29:42 1992
--- gopher1.1+/mindexd/daemon.c	Tue Dec 15 12:46:53 1992
***************
*** 14,22 ****
   * (From Stevens pg 82)
   */
  
! #include <sys/ioctl.h>
! #include <sys/wait.h>
! #include <signal.h>
  
  #ifdef HP9000
    #define TIOCNOTTY       _IO('t', 113)           /* void tty association */
--- 14,20 ----
   * (From Stevens pg 82)
   */
  
! #include "Wait.h"
  
  #ifdef HP9000
    #define TIOCNOTTY       _IO('t', 113)           /* void tty association */
***************
*** 30,36 ****
        */
  
       int pid;
!      union wait  status;
  
       while ( (pid = wait3(&status, WNOHANG, (struct rusage *) 0)) > 0)
  	  ;
--- 28,34 ----
        */
  
       int pid;
!      Portawait  status;
  
       while ( (pid = wait3(&status, WNOHANG, (struct rusage *) 0)) > 0)
  	  ;
***************
*** 94,100 ****
  	   * Ensure the process can't reacquire a new controlling terminal
  	   */
  	  
! #ifdef SIGTSTP  /* BSD */
  
  	  if (setpgrp(0, getpid()) == -1)
  	       err_sys("can't change process group");
--- 92,98 ----
  	   * Ensure the process can't reacquire a new controlling terminal
  	   */
  	  
! #if defined(SIGTSTP) && !defined(M_SCOUNIX)  /* BSD */
  
  	  if (setpgrp(0, getpid()) == -1)
  	       err_sys("can't change process group");
diff -c -r -b gopher1.1/mindexd/error.c gopher1.1+/mindexd/error.c
*** gopher1.1/mindexd/error.c	Thu Apr  9 15:35:42 1992
--- gopher1.1+/mindexd/error.c	Tue Dec 15 12:46:54 1992
***************
*** 56,62 ****
  	if (pname != NULL)
  		fprintf(stderr, "%s: ",pname);
  	fmt = va_arg(args, char *);
! 	printf(stderr, fmt, args);
  	fputc('\n', stderr);
  	va_end(args);
  
--- 56,62 ----
  	if (pname != NULL)
  		fprintf(stderr, "%s: ",pname);
  	fmt = va_arg(args, char *);
! 	fprintf(stderr, fmt, args);
  	fputc('\n', stderr);
  	va_end(args);
  
***************
*** 83,89 ****
  	if (pname != NULL)
  		fprintf(stderr, "%s: ", pname);
  	fmt = va_arg(args, char *);
! 	printf(stderr, fmt, args);
  	va_end(args);
  
  	my_perror();
--- 83,89 ----
  	if (pname != NULL)
  		fprintf(stderr, "%s: ", pname);
  	fmt = va_arg(args, char *);
! 	fprintf(stderr, fmt, args);
  	va_end(args);
  
  	my_perror();
***************
*** 109,115 ****
  	if (pname != NULL)
  		fprintf(stderr, "%s: ", pname);
  	fmt = va_arg(args, char *);
! 	printf(stderr, fmt, args);
  	va_end(args);
  
  	my_perror();
--- 109,115 ----
  	if (pname != NULL)
  		fprintf(stderr, "%s: ", pname);
  	fmt = va_arg(args, char *);
! 	fprintf(stderr, fmt, args);
  	va_end(args);
  
  	my_perror();
***************
*** 138,144 ****
  	if (pname != NULL)
  		fprintf(stderr, "%s: ", pname);
  	fmt = va_arg(args, char *);
! 	printf(stderr, fmt, args);
  	va_end(args);
  
  	my_perror();
--- 138,144 ----
  	if (pname != NULL)
  		fprintf(stderr, "%s: ", pname);
  	fmt = va_arg(args, char *);
! 	fprintf(stderr, fmt, args);
  	va_end(args);
  
  	my_perror();
diff -c -r -b gopher1.1/mindexd/mindexd.h gopher1.1+/mindexd/mindexd.h
*** gopher1.1/mindexd/mindexd.h	Wed Nov 11 20:17:30 1992
--- gopher1.1+/mindexd/mindexd.h	Tue Dec 15 12:46:54 1992
***************
*** 29,31 ****
--- 29,34 ----
  #include "globals.h"
  
  char *pname;
+ #ifdef M_SCOUNIX
+ #include <fcntl.h>
+ #endif
diff -c -r -b gopher1.1/misc/gopherhunt/gopherhunt gopher1.1+/misc/gopherhunt/gopherhunt
*** gopher1.1/misc/gopherhunt/gopherhunt	Tue Apr  7 07:29:39 1992
--- gopher1.1+/misc/gopherhunt/gopherhunt	Tue Dec 15 13:12:08 1992
***************
*** 1,3 ****
--- 1,6 ----
+ :
+ eval "exec /usr/local/bin/perl -S $0 $*"
+     if $running_under_some_shell;
  #!/usr/local/bin/perl
  # gopherhunt - hunt for dead gophers (i.e. dead gopher links...)
  #
***************
*** 22,33 ****
  #If debug = 0, gopherclone runs silent.  =1 is a verbose run.  Commented
  #debug lines are annoyingly thorough
  
! $DEBUG = 0;              #set this to 0 for silent operation
  
  if ($host && $port) {
                           $DEBUG && print "host=$host; port=$port; path=$path\n";
  
!    require 'socket.ph';  # h2ph socket.h, copy socket.h from sys file
                           # and put socket.ph in the current directory
     chop($hostname = `hostname`);        # get host name in variable
  
--- 25,36 ----
  #If debug = 0, gopherclone runs silent.  =1 is a verbose run.  Commented
  #debug lines are annoyingly thorough
  
! $DEBUG = 1;              #set this to 0 for silent operation
  
  if ($host && $port) {
                           $DEBUG && print "host=$host; port=$port; path=$path\n";
  
!    require 'sys/socket.ph';  # h2ph socket.h, copy socket.h from sys file
                           # and put socket.ph in the current directory
     chop($hostname = `hostname`);        # get host name in variable
  
diff -c -r -b gopher1.1/object/Dirent.h gopher1.1+/object/Dirent.h
*** gopher1.1/object/Dirent.h	Thu Dec 10 15:28:20 1992
--- gopher1.1+/object/Dirent.h	Tue Dec 15 13:12:08 1992
***************
*** 33,39 ****
  /*** 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) || defined(_SEQUENT_) || defined(M_XENIX)
  #      include <dirent.h>
  
  /*** Everyone else gets dir.h, plus some funky definitions ***/
--- 33,39 ----
  /*** 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) || defined(_SEQUENT_) || defined(M_XENIX) || defined(M_SCOUNIX)
  #      include <dirent.h>
  
  /*** Everyone else gets dir.h, plus some funky definitions ***/
diff -c -r -b gopher1.1/object/Wait.h gopher1.1+/object/Wait.h
*** gopher1.1/object/Wait.h	Thu Dec 10 15:28:22 1992
--- gopher1.1+/object/Wait.h	Tue Dec 15 13:12:08 1992
***************
*** 35,41 ****
--- 35,46 ----
  #endif
  
  #include <sys/ioctl.h>
+ #ifdef M_SCOUNIX
+ #include <net/sys/wait.h>
+ #else
  #include <sys/wait.h>
+ #endif
+ 
  #include <signal.h>
  
  #if defined(_SEQUENT_) || defined(POSIXWAIT) || defined(_POSIX_SOURCE)

Newsgroups: comp.infosystems.gopher