From 5dcc9bef6ebd6be7ba7b06d355e2cebca2b8f054 Mon Sep 17 00:00:00 2001
From: "Marc G. Fournier" <scrappy@hub.org>
Date: Tue, 15 Apr 1997 18:18:45 +0000
Subject: [PATCH] Patch for Solaris 2.5 from: adrian@waltham.harvard.net

---
 src/GNUmakefile.in                           | 5 +++--
 src/backend/commands/vacuum.c                | 4 +++-
 src/backend/port/sparc_solaris/port-protos.h | 5 ++++-
 src/backend/port/sparc_solaris/port.c        | 6 +++++-
 src/configure                                | 2 +-
 src/configure.in                             | 2 +-
 6 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/src/GNUmakefile.in b/src/GNUmakefile.in
index 6f4f8b4fed3..5a25488a4e0 100644
--- a/src/GNUmakefile.in
+++ b/src/GNUmakefile.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.11 1997/04/09 08:29:17 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.12 1997/04/15 18:17:43 scrappy Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -80,7 +80,8 @@ distclean: clean
 		bin/pg_dump/Makefile \
 		include/config.h \
 		backend/utils/Gen_fmgrtab.sh \
-		include/os.h
+		include/os.h \
+		Makefile.port
 
 
 .DEFAULT:
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index e7ffe2d57e6..2df4d172bd1 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.27 1997/04/02 03:48:01 vadim Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.28 1997/04/15 18:18:21 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,6 +53,8 @@
 # include <sys/resource.h>
 #endif 
 
+#include <port-protos.h>
+
 bool VacuumRunning =	false;
 static int MESSAGE_LEVEL;	/* message level */
 
diff --git a/src/backend/port/sparc_solaris/port-protos.h b/src/backend/port/sparc_solaris/port-protos.h
index 01c073e9570..c2cbf5803b5 100644
--- a/src/backend/port/sparc_solaris/port-protos.h
+++ b/src/backend/port/sparc_solaris/port-protos.h
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: port-protos.h,v 1.3 1996/12/28 02:11:49 momjian Exp $
+ * $Id: port-protos.h,v 1.4 1997/04/15 18:18:33 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -45,5 +45,8 @@ extern int inet_aton(const char *cp, struct in_addr *addr);
 /* In system library, but can't find prototype in system library .h files */
 extern int gethostname(char *name, int namelen);
 
+/* In system library, but can't find prototype in system library .h files */
+#include <sys/resource.h>
+extern int getrusage(int who, struct rusage *rusage);
 
 #endif /* PORT_PROTOS_H */
diff --git a/src/backend/port/sparc_solaris/port.c b/src/backend/port/sparc_solaris/port.c
index eab445a49df..8710ec95451 100644
--- a/src/backend/port/sparc_solaris/port.c
+++ b/src/backend/port/sparc_solaris/port.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/port/sparc_solaris/Attic/port.c,v 1.3 1996/11/27 08:15:25 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/port/sparc_solaris/Attic/port.c,v 1.4 1997/04/15 18:18:45 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -18,7 +18,9 @@
 
 #include "postgres.h"
 #include "port-protos.h"
+#ifndef HAVE_GETRUSAGE
 #include "rusagestub.h"
+#endif /* HAVE_GETRUSAGE */
 
 long
 random()
@@ -32,6 +34,7 @@ srandom(int seed)
     srand48((long int) seed);
 }
 
+#ifndef HAVE_GETRUSAGE
 int
 getrusage(int who, struct rusage *rusage)
 {
@@ -68,3 +71,4 @@ getrusage(int who, struct rusage *rusage)
     rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
     return(0);
 }
+#endif /* HAVE_GETRUSAGE */
diff --git a/src/configure b/src/configure
index bb62af05898..9e9993d1979 100755
--- a/src/configure
+++ b/src/configure
@@ -1076,7 +1076,7 @@ INSTLOPTS="-m 444"
 INSTL_EXE_OPTS="-m 555"
 INSTL_LIB_OPTS="-m 664"
 
-if test "`echo $INSTALL | awk '{ i=split($1, a, "/"); print a[i] }'`." = "install."
+if test "`basename $INSTALL`." = "install."
 then
 	INSTLOPTS="-c $INSTLOPTS"
 	INSTL_EXE_OPTS="-c $INSTL_EXE_OPTS"
diff --git a/src/configure.in b/src/configure.in
index 64a4058b328..a5b144f9dc5 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -279,7 +279,7 @@ INSTLOPTS="-m 444"
 INSTL_EXE_OPTS="-m 555"
 INSTL_LIB_OPTS="-m 664"
 
-if test "`echo $INSTALL | awk '{ i=split($1, a, "/"); print a[[i]] }'`." = "install."
+if test "`basename $INSTALL`." = "install."
 then
 	INSTLOPTS="-c $INSTLOPTS"
 	INSTL_EXE_OPTS="-c $INSTL_EXE_OPTS"
-- 
GitLab