The following is a patch file for the initial postgres version 3
release 1 distribution.  There were installation problems that
showed up when compiling on SPARCstation's running 4.1 and up
(which is of course just about everyone who has a sparc).  This also
fixes a bug in the installation scripts that shows up on all platforms.
If you ftp'ed this patch at the same time you ftp'ed postgres then you
don't need it.  The distribution itself has been patched and 
should now install correctly.

To apply this patch take everything below the cut here line and put
it in a file in your $POSTGRESHOME directory.  Then run the command

	patch -p0 < patchfile

After doing this run the following commands to install postgres:

	cd ~postgres/newconf
	Make everything install

if you have problems send mail to bug-postgres@postgres.berkeley.edu

---------------------------- cut here ----------------------------------
*** old/src/lib/libpq/obe-fsstubs.c	Wed Dec  4 07:25:34 1991
--- src/lib/libpq/be-fsstubs.c	Wed Dec  4 07:33:07 1991
***************
*** 408,420 ****
       char *path;
  {
      struct varlena *ret;
!     struct stat *st;
      unsigned int nblocks, byte_offset;
      int len;
!     len = sizeof(struct stat);
      ret = (struct varlena *) palloc(len+sizeof(int32));
      VARSIZE(ret) = len;
!     st = (struct stat *)VARDATA(ret);
      bzero(st,len);	/* default values of 0 */
  #if 0
      if (!LOisdir(path)) {
--- 408,420 ----
       char *path;
  {
      struct varlena *ret;
!     struct pgstat *st;
      unsigned int nblocks, byte_offset;
      int len;
!     len = sizeof(struct pgstat);
      ret = (struct varlena *) palloc(len+sizeof(int32));
      VARSIZE(ret) = len;
!     st = (struct pgstat *)VARDATA(ret);
      bzero(st,len);	/* default values of 0 */
  #if 0
      if (!LOisdir(path)) {
*** old/src/executor/oex_debug.c	Wed Dec  4 07:40:16 1991
--- src/executor/ex_debug.c	Wed Dec  4 07:40:31 1991
***************
*** 17,23 ****
   *	$Header: RCS/ex_debug.c,v 1.5 91/11/14 10:56:11 glass Exp $
   * ----------------------------------------------------------------
   */
! #include "executor/executor.h
  
   RcsId("$Header: RCS/ex_debug.c,v 1.5 91/11/14 10:56:11 glass Exp $");
  
--- 17,23 ----
   *	$Header: RCS/ex_debug.c,v 1.5 91/11/14 10:56:11 glass Exp $
   * ----------------------------------------------------------------
   */
! #include "executor/executor.h"
  
   RcsId("$Header: RCS/ex_debug.c,v 1.5 91/11/14 10:56:11 glass Exp $");
  
*** old/src/lib/libpq/ofe-pqufs.c	Wed Dec  4 07:34:08 1991
--- src/lib/libpq/fe-pqufs.c	Wed Dec  4 07:35:13 1991
***************
*** 368,374 ****
  
  int p_stat(path,statbuf)
       char *path;
!      struct stat *statbuf;
  {
      int stlen;
      PQArgBlock argv[2];
--- 368,374 ----
  
  int p_stat(path,statbuf)
       char *path;
!      struct pgstat *statbuf;
  {
      int stlen;
      PQArgBlock argv[2];
***************
*** 378,384 ****
      argv[0].len = VAR_LENGTH_ARG;
      argv[0].u.ptr = (int *)resolve_path(path);
  
!     pqret = PQfn(F_LOSTAT,(int *)statbuf,sizeof(struct stat),&stlen,2,argv,1);
  
      if (stlen == 5)
        return -1;
--- 378,384 ----
      argv[0].len = VAR_LENGTH_ARG;
      argv[0].u.ptr = (int *)resolve_path(path);
  
!     pqret = PQfn(F_LOSTAT,(int *)statbuf,sizeof(struct pgstat),&stlen,2,argv,1);
  
      if (stlen == 5)
        return -1;
***************
*** 479,485 ****
  int p_chdir(path)
       char *path;
  {
!     struct stat st;
  
      if (p_stat(path,&st) < 0)
        return -1;
--- 479,485 ----
  int p_chdir(path)
       char *path;
  {
!     struct pgstat st;
  
      if (p_stat(path,&st) < 0)
        return -1;
*** old/src/lib/H/planner/ointernal.h	Wed Dec  4 13:02:41 1991
--- src/lib/H/planner/internal.h	Tue Dec  3 08:20:27 1991
***************
*** 27,33 ****
  #include "nodes/plannodes.h"
  #include "parser/parsetree.h"
  #include "nodes/relation.h"
! #include "catalog/pg_index.h
  #include "tmp/c.h"
  
  /* XXX - versions don't work yet, so parsetree doesn't have them,
--- 27,33 ----
  #include "nodes/plannodes.h"
  #include "parser/parsetree.h"
  #include "nodes/relation.h"
! #include "catalog/pg_index.h"
  #include "tmp/c.h"
  
  /* XXX - versions don't work yet, so parsetree doesn't have them,
*** old/src/lib/H/tmp/olibpq-fs.h	Wed Dec  4 07:22:16 1991
--- src/lib/H/tmp/libpq-fs.h	Wed Dec  4 11:17:43 1991
***************
*** 39,45 ****
  #endif
  
  /* Temp workaround until we make unix stuff compile under all oses */
! struct stat {
  	int st_mode;
  	int b;
  	int c;
--- 39,45 ----
  #endif
  
  /* Temp workaround until we make unix stuff compile under all oses */
! struct pgstat {
  	int st_mode;
  	int b;
  	int c;
***************
*** 69,75 ****
  int p_rmdir ARGS((char *path ));
  int p_ferror ARGS((int fd ));
  int p_rename ARGS((char *path , char *pathnew ));
! int p_stat ARGS((char *path , struct stat *statbuf ));
  PDIR *p_opendir ARGS((char *path ));
  struct pgdirent *p_readdir ARGS((PDIR *dirp ));
  void p_rewinddir ARGS((PDIR *dirp ));
--- 69,75 ----
  int p_rmdir ARGS((char *path ));
  int p_ferror ARGS((int fd ));
  int p_rename ARGS((char *path , char *pathnew ));
! int p_stat ARGS((char *path , struct pgstat *statbuf ));
  PDIR *p_opendir ARGS((char *path ));
  struct pgdirent *p_readdir ARGS((PDIR *dirp ));
  void p_rewinddir ARGS((PDIR *dirp ));
*** old/newconf/oinstall.sh	Wed Dec  4 08:56:11 1991
--- newconf/install.sh	Wed Dec  4 08:57:28 1991
***************
*** 271,274 ****
--- 271,281 ----
      fi
  fi
  
+ echo
+ if [ $DEVELOPMENT = "f" ]
+ then
+ 	echo "Cleaning up..."
+ 	rm -f $OBJ/*.o
+ fi
+ 
  echo "Installation complete."
*** old/newconf/opostgres.mk	Wed Dec  4 08:22:10 1991
--- newconf/postgres.mk	Wed Dec  4 08:56:05 1991
***************
*** 298,306 ****
  POSTGRES.o: $(ALLMODS)
  	@ echo linking postgres
  	@ $(CC) $(PORTLDFLAGS) $(LDFLAGS) -o $(OD)/support/postgres $(ALLMODS) $(LIBS)
- 	@ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
- 		    rm -f $(ALLMODS); \
- 		 else true ; fi'
  	@ sh -c 'if (test $$STRIPOBJS = "t" ) then \
  		    strip $(OD)/support/postgres ; \
  		 else true ; fi'
--- 298,303 ----
