summaryrefslogtreecommitdiff
path: root/databases/postgresql/patches
diff options
context:
space:
mode:
authorjlam <jlam>1999-09-19 04:24:53 +0000
committerjlam <jlam>1999-09-19 04:24:53 +0000
commit437b89763802f5c6c9ce2eec03c5465853edd9a2 (patch)
tree3bc7ee4f12f2669b0b065e52c4579738b645412b /databases/postgresql/patches
parent2d82967cfceb8989a49efca8c41b42f49e66d9d1 (diff)
downloadpkgsrc-437b89763802f5c6c9ce2eec03c5465853edd9a2.tar.gz
Update postgresql to 6.5.1. Completely libtoolized and ldconfig statements
removed, but this should still function correctly on a.out systems. This package was originally submitted by D'Arcy J.M. Cain, but with major overhauling by me. Closes PR#7865 and relevant part of PR#8299. Major changes from version 6.4.2: Multi-version concurrency control(MVCC) This removes our old table-level locking, and replaces it with a locking system that is superior to most commercial database systems. In a traditional system, each row that is modified is locked until committed, preventing reads by other users. MVCC uses the natural multi-version nature of PostgreSQL to allow readers to continue reading consistent data during writer activity. Writers continue to use the compact pg_log transaction system. This is all performed without having to allocate a lock for every row like traditional database systems. So, basically, we no longer are restricted by simple table-level locking; we have something better than row-level locking. Hot backups from pg_dump pg_dump takes advantage of the new MVCC features to give a consistant database dump/backup while the database stays online and available for queries. Numeric data type We now have a true numeric data type, with user-specified precision. Temporary tables Temporary tables are guaranteed to have unique names within a database session, and are destroyed on session exit. New SQL features We now have CASE, INTERSECT, and EXCEPT statement support. We have new LIMIT/OFFSET, SET TRANSACTION ISOLATION LEVEL, SELECT ... FOR UPDATE, and an improved LOCK TABLE command. Speedups We continue to speed up PostgreSQL, thanks to the variety of talents within our team. We have sped up memory allocation, optimization, table joins, and row transfer routines. Ports We continue to expand our port list, this time including WinNT/ix86 and NetBSD/arm32. Interfaces Most interfaces have new versions, and existing functionality has been improved. Documentation New and updated material is present throughout the documentation. New FAQs have been contributed for SGI and AIX platforms. The Tutorial has introductory information on SQL from Stefan Simkovics. For the User's Guide, there are reference pages covering the postmaster and more utility programs, and a new appendix contains details on date/time behavior. The Administrator's Guide has a new chapter on troubleshooting from Tom Lane. And the Programmer's Guide has a description of query processing, also from Stefan, and details on obtaining the Postgres source tree via anonymous CVS and CVSup.
Diffstat (limited to 'databases/postgresql/patches')
-rw-r--r--databases/postgresql/patches/patch-aa73
-rw-r--r--databases/postgresql/patches/patch-ab123
-rw-r--r--databases/postgresql/patches/patch-ac48
-rw-r--r--databases/postgresql/patches/patch-ad38
-rw-r--r--databases/postgresql/patches/patch-ae79
-rw-r--r--databases/postgresql/patches/patch-af48
-rw-r--r--databases/postgresql/patches/patch-ag40
-rw-r--r--databases/postgresql/patches/patch-ah55
-rw-r--r--databases/postgresql/patches/patch-ai55
-rw-r--r--databases/postgresql/patches/patch-aj25
-rw-r--r--databases/postgresql/patches/patch-ak13
-rw-r--r--databases/postgresql/patches/patch-al29
-rw-r--r--databases/postgresql/patches/patch-am56
13 files changed, 471 insertions, 211 deletions
diff --git a/databases/postgresql/patches/patch-aa b/databases/postgresql/patches/patch-aa
index 65822590641..2a3a2908874 100644
--- a/databases/postgresql/patches/patch-aa
+++ b/databases/postgresql/patches/patch-aa
@@ -1,35 +1,50 @@
-$NetBSD: patch-aa,v 1.1 1999/01/04 13:05:01 frueauf Exp $
+$NetBSD: patch-aa,v 1.2 1999/09/19 04:24:54 jlam Exp $
---- include/utils/memutils.h.orig Mon Sep 7 07:35:48 1998
-+++ include/utils/memutils.h Tue Dec 29 00:50:38 1998
-@@ -58,13 +58,17 @@
- #define SHORTALIGN(LEN)\
- (((long)(LEN) + (sizeof (short) - 1)) & ~(sizeof (short) - 1))
+--- ./Makefile.global.in.orig Thu Jun 24 20:13:45 1999
++++ ./Makefile.global.in Sat Sep 18 03:20:03 1999
+@@ -54,6 +54,15 @@
+ ELF_SYSTEM= @ELF_SYS@
-+#if defined(m68k)
-+#define INTALIGN(LEN) SHORTALIGN(LEN)
-+#else
- #define INTALIGN(LEN)\
- (((long)(LEN) + (sizeof (int) - 1)) & ~(sizeof (int) -1))
-+#endif
+ LIBPQDIR:= $(SRCDIR)/interfaces/libpq
++LIBPGTCLDIR:= $(SRCDIR)/interfaces/libpgtcl
++
++ifneq ($(LIBTOOL),)
++LIBPQ:= $(LIBPQDIR)/libpq.la
++LIBPGTCL:= $(LIBPGTCLDIR)/libpgtcl.la
++else
++LIBPQ:= -L$(LIBPQDIR) -lpq
++LIBPGTCL:= -L$(LIBPGTCLDIR) -lpgtcl
++endif
- /*
- * LONGALIGN(LEN) - length (or address) aligned for longs
- */
--#if defined(sun) && ! defined(sparc)
-+#if (defined(sun) && ! defined(sparc)) || defined(m68k)
- #define LONGALIGN(LEN) SHORTALIGN(LEN)
- #elif defined (__alpha)
+ # For convenience, POSTGRESDIR is where BINDIR, and LIBDIR
+ # and other target destinations are rooted. Of course, each of these is
+@@ -200,6 +209,7 @@
+ #-------------------------------------------------------------
+ CC= @CC@
+ CPP= @CPP@
++CXX= @CXX@
+ YFLAGS= @YFLAGS@
+ YACC= @YACC@
+ LEX= @LEX@
+@@ -242,7 +252,7 @@
+ ##############################################################################
-@@ -81,7 +85,10 @@
- (((long)(LEN) + (sizeof (long) - 1)) & ~(sizeof (long) -1))
- #endif
+ ifneq ($(CUSTOM_INSTALL),)
+-INSTALL= $(CUSTOM_INSTALL)
++INSTALL:= $(CUSTOM_INSTALL)
+ endif
--#if ! defined(sco)
-+#if defined(m68k)
-+#define DOUBLEALIGN(LEN) SHORTALIGN(LEN)
-+#define MAXALIGN(LEN) SHORTALIGN(LEN)
-+#elif ! defined(sco)
- #define DOUBLEALIGN(LEN)\
- (((long)(LEN) + (sizeof (double) - 1)) & ~(sizeof (double) -1))
+ #
+@@ -273,7 +283,11 @@
+ # using a i486 or better.
+ ifneq ($(CUSTOM_CC),)
+- CC= $(CUSTOM_CC)
++ CC:= $(CUSTOM_CC)
++endif
++
++ifneq ($(CUSTOM_CXX),)
++ CXX:= $(CUSTOM_CXX)
+ endif
+
+ ifneq ($(CUSTOM_COPT),)
diff --git a/databases/postgresql/patches/patch-ab b/databases/postgresql/patches/patch-ab
index a3cca8ffbf6..4daf00ae237 100644
--- a/databases/postgresql/patches/patch-ab
+++ b/databases/postgresql/patches/patch-ab
@@ -1,30 +1,101 @@
-$NetBSD: patch-ab,v 1.5 1999/01/04 13:05:01 frueauf Exp $
+$NetBSD: patch-ab,v 1.6 1999/09/19 04:24:54 jlam Exp $
---- backend/storage/buffer/s_lock.c.orig Fri Sep 18 19:18:39 1998
-+++ backend/storage/buffer/s_lock.c Tue Dec 29 00:50:38 1998
-@@ -117,6 +117,25 @@
-
- #endif /* PPC */
-
-+#if defined(__m68k__)
-+static void
-+tas_dummy() /* really means: extern int tas(slock_t **lock); */
-+{
-+ __asm__(" \n\
-+.global _tas \n\
-+_tas: \n\
-+ movel sp@(0x4),a0 \n\
-+ tas a0@ \n\
-+ beq _success \n\
-+ moveq #-128,d0 \n\
-+ rts \n\
-+_success: \n\
-+ moveq #0,d0 \n\
-+ rts \n\
-+ ");
-+}
+--- ./Makefile.shlib.orig Fri Jul 16 18:46:16 1999
++++ ./Makefile.shlib Sat Sep 18 17:34:59 1999
+@@ -50,6 +50,7 @@
+ # on a platform where we don't know how to build a shared library.
+ shlib :=
+ install-shlib-dep :=
++lib_to_install := lib$(NAME).a
+
+ # For each platform we support shlibs on, set shlib and install-shlib-dep,
+ # and update flags as needed to build a shared lib. Note we depend on
+@@ -64,7 +65,7 @@
+ endif
+
+ ifeq ($(PORTNAME), freebsd)
+- ifdef BSD_SHLIB
++ ifneq $(BSD_SHLIB),)
+ install-shlib-dep := install-shlib
+ ifdef ELF_SYSTEM
+ shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+@@ -78,7 +79,8 @@
+ endif
+
+ ifeq ($(PORTNAME), bsd)
+- ifdef BSD_SHLIB
++ ifneq ($(BSD_SHLIB),)
++ ifeq ($(LIBTOOL),)
+ install-shlib-dep := install-shlib
+ shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+ ifdef ELF_SYSTEM
+@@ -87,11 +89,16 @@
+ LDFLAGS_SL := -x -Bshareable -Bforcearchive
+ endif
+ CFLAGS += $(CFLAGS_SL)
+- endif
++ else
++ lalib := lib$(NAME).la
++ lib_to_install := $(lalib)
++ LIBTOOL_FLAGS += -rpath $(LIBDIR) -version-info $(SO_MAJOR_VERSION):$(SO_MINOR_VERSION)
++ endif # !LIBTOOL
++ endif # BSD_SHLIB
+ endif
+
+ ifeq ($(PORTNAME), bsdi)
+- ifdef BSD_SHLIB
++ ifneq ($(BSD_SHLIB),)
+ ifeq ($(DLSUFFIX), .so)
+ install-shlib-dep := install-shlib
+ shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+@@ -183,7 +190,7 @@
+
+ # Default target definition. Note shlib is empty if not building a shlib.
+
+-all: lib$(NAME).a $(shlib)
++all: $(lib_to_install) $(shlib)
+
+ # Rules to build regular and shared libraries
+
+@@ -197,6 +204,21 @@
+ $(RANLIB) $@
+ endif
+
++ifneq ($(LIBTOOL),)
++ifneq ($(PORTNAME), win)
++
++ifeq ($(CXXLIB), true)
++LINKER= CXX
++else
++LINKER= CC
++endif
++
++$(lalib): $(OBJS)
++ $($(LINKER)) $(CPPFLAGS) $($(LINKER)FLAGS) -o $@ $(OBJS:.o=.lo) $(LIBTOOL_FLAGS)
++
++endif
++endif
+
-+#endif /* __m68k__ */
+ ifneq ($(shlib),)
+ ifneq ($(PORTNAME), win)
+
+@@ -228,8 +250,8 @@
+
+ .PHONY: all install-lib install-shlib
+
+-install-lib: lib$(NAME).a
+- $(INSTALL) $(INSTL_LIB_OPTS) lib$(NAME).a $(LIBDIR)/lib$(NAME).a
++install-lib: $(lib_to_install)
++ $(INSTALL) $(INSTL_LIB_OPTS) $(lib_to_install) $(LIBDIR)
+ install-shlib: $(shlib)
+ $(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib)
+@@ -251,4 +273,8 @@
+ .PHONY: clean-shlib
- #else /* defined(__GNUC__) */
+ clean-shlib:
++ifneq ($(LIBTOOL),)
++ $(LIBTOOL) rm -rf $(lalib)
++else
+ rm -f $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX)
++endif
diff --git a/databases/postgresql/patches/patch-ac b/databases/postgresql/patches/patch-ac
index 9776f054f7a..859c02313e4 100644
--- a/databases/postgresql/patches/patch-ac
+++ b/databases/postgresql/patches/patch-ac
@@ -1,25 +1,25 @@
-$NetBSD: patch-ac,v 1.3 1999/01/04 13:05:01 frueauf Exp $
+$NetBSD: patch-ac,v 1.4 1999/09/19 04:24:54 jlam Exp $
---- configure.in-orig Sun Dec 13 21:08:20 1998
-+++ configure.in Tue Dec 29 01:33:56 1998
-@@ -786,7 +786,7 @@
- dnl If --with-tclconfig was given, don't check for tclsh, tcl
- if test -z "$TCL_DIRS"
- then
-- AC_PATH_PROG(TCLSH, tclsh)
-+ AC_PATH_PROG(TCLSH, tclsh8.0)
- if test -z "$TCLSH"
- then
- AC_PATH_PROG(TCLSH, tcl)
-@@ -834,9 +834,9 @@
- # library_dirs are set in the check for TCL
- for dir in $library_dirs
- do
-- if test -d "$dir" -a -r "$dir/tkConfig.sh"
-+ if test -d "$dir" -a -r "$dir/../tk8.0/tkConfig.sh"
- then
-- TK_CONFIG_SH=$dir/tkConfig.sh
-+ TK_CONFIG_SH=$dir/../tk8.0/tkConfig.sh
- break
- fi
- done
+--- ./bin/pg_dump/Makefile.in.orig Sun Jan 17 01:19:05 1999
++++ ./bin/pg_dump/Makefile.in Sat Sep 18 03:16:08 1999
+@@ -26,17 +26,13 @@
+ CFLAGS+= $(KRBFLAGS)
+ endif
+
+-all: submake pg_dump
++all: pg_dump
+
+-pg_dump: $(OBJS) $(LIBPQDIR)/libpq.a
+- $(CC) -o pg_dump -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
++pg_dump: $(OBJS)
++ $(CC) -o pg_dump $(OBJS) $(LIBPQ) $(LDFLAGS)
+
+ ../../utils/strdup.o:
+ $(MAKE) -C ../../utils strdup.o
+-
+-.PHONY: submake
+-submake:
+- $(MAKE) -C $(LIBPQDIR) libpq.a
+
+ install: pg_dump
+ $(INSTALL) $(INSTL_EXE_OPTS) pg_dump$(X) $(BINDIR)/pg_dump$(X)
diff --git a/databases/postgresql/patches/patch-ad b/databases/postgresql/patches/patch-ad
index 46c895b60ff..2c7083a9cfb 100644
--- a/databases/postgresql/patches/patch-ad
+++ b/databases/postgresql/patches/patch-ad
@@ -1,27 +1,15 @@
-$NetBSD: patch-ad,v 1.4 1999/01/04 13:05:01 frueauf Exp $
+$NetBSD: patch-ad,v 1.5 1999/09/19 04:24:54 jlam Exp $
---- configure-orig Sun Dec 13 21:08:20 1998
-+++ configure Tue Dec 29 01:34:06 1998
-@@ -5315,8 +5315,8 @@
+--- ./bin/pg_encoding/Makefile.orig Sat Jun 5 06:27:31 1999
++++ ./bin/pg_encoding/Makefile Sat Sep 18 03:16:50 1999
+@@ -19,8 +19,8 @@
- if test -z "$TCL_DIRS"
- then
-- # Extract the first word of "tclsh", so it can be a program name with args.
--set dummy tclsh; ac_word=$2
-+ # Extract the first word of "tclsh8.0", so it can be a program name with args.
-+set dummy tclsh8.0; ac_word=$2
- echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
- echo "configure:5322: checking for $ac_word" >&5
- if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
-@@ -5424,9 +5424,9 @@
- # library_dirs are set in the check for TCL
- for dir in $library_dirs
- do
-- if test -d "$dir" -a -r "$dir/tkConfig.sh"
-+ if test -d "$dir" -a -r "$dir/../tk8.0/tkConfig.sh"
- then
-- TK_CONFIG_SH=$dir/tkConfig.sh
-+ TK_CONFIG_SH=$dir/../tk8.0/tkConfig.sh
- break
- fi
- done
+ all: pg_encoding
+
+-pg_encoding: $(OBJS) $(LIBPQDIR)/libpq.a
+- $(CC) -o pg_encoding $(OBJS) -L$(LIBPQDIR) -lpq $(LDFLAGS)
++pg_encoding: $(OBJS)
++ $(CC) -o pg_encoding $(OBJS) $(LIBPQ) $(LDFLAGS)
+
+ install: pg_encoding
+ $(INSTALL) $(INSTL_EXE_OPTS) pg_encoding$(X) $(BINDIR)/pg_encoding$(X)
diff --git a/databases/postgresql/patches/patch-ae b/databases/postgresql/patches/patch-ae
index e8eef3f7087..d28fcdb7403 100644
--- a/databases/postgresql/patches/patch-ae
+++ b/databases/postgresql/patches/patch-ae
@@ -1,63 +1,18 @@
-$NetBSD: patch-ae,v 1.8 1999/09/06 07:01:44 sakamoto Exp $
+$NetBSD: patch-ae,v 1.9 1999/09/19 04:24:54 jlam Exp $
-diff -rc2 config.sub config.sub
-*** config.sub Tue Mar 25 02:16:33 1997
---- config.sub Thu Mar 4 21:46:43 1999
-***************
-*** 150,154 ****
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
-! tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
- | arme[lb] | pyramid \
- | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
---- 150,154 ----
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
-! tahoe | i860 | m68k | m68000 | m88k | ns32k | arm | arm32 \
- | arme[lb] | pyramid \
- | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
-***************
-*** 178,182 ****
- | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
- | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
-! | mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
- ;;
- # Recognize the various machine names and aliases which stand
---- 178,182 ----
- | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
- | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
-! | mips64el-* | mips64orion-* | mips64orionel-* | f301-* | arm32-*)
- ;;
- # Recognize the various machine names and aliases which stand
-diff -rc2 configure configure
-*** configure Sun Dec 13 15:08:20 1998
---- configure Thu Mar 4 21:52:02 1999
-***************
-*** 741,745 ****
- rm -f conftest.sh
- sed 's/^\([A-Za-z_]*\):\(.*\)$/\1="\2"/' "template/$TEMPLATE" >conftest.sh
-! . conftest.sh
- rm -f conftest.sh
-
---- 741,745 ----
- rm -f conftest.sh
- sed 's/^\([A-Za-z_]*\):\(.*\)$/\1="\2"/' "template/$TEMPLATE" >conftest.sh
-! . ./conftest.sh
- rm -f conftest.sh
-
-diff -rc2 configure.in configure.in
-*** configure.in Sun Dec 13 15:08:20 1998
---- configure.in Thu Mar 4 21:54:10 1999
-***************
-*** 148,152 ****
- rm -f conftest.sh
- sed 's/^\([A-Za-z_]*\):\(.*\)$/\1="\2"/' "template/$TEMPLATE" >conftest.sh
-! . conftest.sh
- rm -f conftest.sh
- ]
---- 148,152 ----
- rm -f conftest.sh
- sed 's/^\([A-Za-z_]*\):\(.*\)$/\1="\2"/' "template/$TEMPLATE" >conftest.sh
-! . ./conftest.sh
- rm -f conftest.sh
- ]
+--- ./bin/pg_id/Makefile.orig Sun Jan 17 01:19:10 1999
++++ ./bin/pg_id/Makefile Sat Sep 18 03:17:25 1999
+@@ -26,11 +26,8 @@
+
+ all: pg_id
+
+-pg_id: $(OBJS) $(LIBPQDIR)/libpq.a
+- $(CC) -o pg_id -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
+-
+-$(LIBPQDIR)/libpq.a:
+- $(MAKE) -C $(LIBPQDIR) libpq.a
++pg_id: $(OBJS)
++ $(CC) -o pg_id $(OBJS) $(LIBPQ) $(LDFLAGS)
+
+ install: pg_id
+ $(INSTALL) $(INSTL_EXE_OPTS) pg_id$(X) $(BINDIR)/pg_id$(X)
diff --git a/databases/postgresql/patches/patch-af b/databases/postgresql/patches/patch-af
index 922910f2e88..ea841cbc750 100644
--- a/databases/postgresql/patches/patch-af
+++ b/databases/postgresql/patches/patch-af
@@ -1,29 +1,21 @@
-$NetBSD: patch-af,v 1.5 1999/07/11 20:00:43 bad Exp $
+$NetBSD: patch-af,v 1.6 1999/09/19 04:24:54 jlam Exp $
-*** include/storage/s_lock.h Sat Apr 10 19:43:01 1999
---- include/storage/s_lock.h Wed Apr 7 03:06:53 1999
-***************
-*** 124,129 ****
---- 124,145 ----
-
-
-
-+ #if defined(__arm32__)
-+ #define TAS(lock) tas(lock)
-+
-+ static __inline__ int
-+ tas(volatile slock_t *lock)
-+ {
-+ register slock_t _res = 1;
-+
-+ __asm__("swpb %0, %0, [%3]": "=r"(_res), "=m"(*lock):"0"(_res), "r" (lock));
-+ return (int) _res;
-+ }
-+
-+ #endif /* __arm32__ */
-+
-+
-+
- #if defined(sparc)
- #define TAS(lock) tas(lock)
-
+--- ./bin/pgtclsh/Makefile.orig Tue Oct 27 16:51:54 1998
++++ ./bin/pgtclsh/Makefile Sat Sep 18 03:14:32 1999
+@@ -22,15 +22,12 @@
+ include Makefile.tkdefs
+ endif
+
+-CFLAGS+= $(X_CFLAGS) -I$(SRCDIR)/interfaces/libpgtcl
++CFLAGS+= $(X_CFLAGS) -I$(LIBPGTCLDIR)
+
+ ifdef KRBVERS
+ LDFLAGS+= $(KRBLIBS)
+ CFLAGS+= $(KRBFLAGS)
+ endif
+-
+-LIBPGTCL= -L$(SRCDIR)/interfaces/libpgtcl -lpgtcl
+-LIBPQ= -L$(LIBPQDIR) -lpq
+
+ # If we are here then TCL is available
+ PGMS = pgtclsh
diff --git a/databases/postgresql/patches/patch-ag b/databases/postgresql/patches/patch-ag
index 930b87bbf3b..fcc64e17db3 100644
--- a/databases/postgresql/patches/patch-ag
+++ b/databases/postgresql/patches/patch-ag
@@ -1,19 +1,25 @@
-$NetBSD: patch-ag,v 1.3 1999/07/11 20:00:43 bad Exp $
+$NetBSD: patch-ag,v 1.4 1999/09/19 04:24:54 jlam Exp $
---- include/port/bsd.h.orig Sun Jul 19 03:19:53 1998
-+++ include/port/bsd.h Sun Jul 11 21:49:27 1999
-@@ -24,6 +24,14 @@
- #define HAS_TEST_AND_SET
- #endif
+--- ./bin/psql/Makefile.in.orig Sun Jan 17 01:19:19 1999
++++ ./bin/psql/Makefile.in Sat Sep 18 03:18:28 1999
+@@ -30,17 +30,13 @@
-+#if defined(__arm32__)
-+#define HAS_TEST_AND_SET
-+#endif
-+
-+#if defined(__powerpc__)
-+#define HAS_TEST_AND_SET
-+#endif
-+
- #if defined(__mips__)
- /* # undef HAS_TEST_AND_SET */
- #endif
+ OBJS= psql.o stringutils.o @STRDUP@ @STRERROR2@
+
+-all: submake psql
++all: psql
+
+-psql: $(OBJS) $(LIBPQDIR)/libpq.a
+- $(CC) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
++psql: $(OBJS)
++ $(CC) -o psql $(OBJS) $(LIBPQ) $(LDFLAGS)
+
+ ../../utils/strdup.o:
+ $(MAKE) -C ../../utils strdup.o
+-
+-.PHONY: submake
+-submake:
+- $(MAKE) -C $(LIBPQDIR) libpq.a
+
+ install: psql
+ $(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)
diff --git a/databases/postgresql/patches/patch-ah b/databases/postgresql/patches/patch-ah
new file mode 100644
index 00000000000..f6200846257
--- /dev/null
+++ b/databases/postgresql/patches/patch-ah
@@ -0,0 +1,55 @@
+$NetBSD: patch-ah,v 1.3 1999/09/19 04:24:55 jlam Exp $
+
+--- ./configure.in.orig Sat May 29 20:06:44 1999
++++ ./configure.in Sat Sep 18 03:21:22 1999
+@@ -23,11 +23,7 @@
+ bsdi*) os=bsdi need_tas=no ;;
+ freebsd1*|freebsd2*) os=freebsd need_tas=no ;;
+ freebsd*) os=freebsd need_tas=no elf=yes ;;
+- netbsd*)
+- os=bsd need_tas=no
+- case "$host_cpu" in
+- powerpc) elf=yes ;;
+- esac ;;
++ netbsd*) os=bsd need_tas=no elf=maybe ;; # mix of a.out & ELF platforms
+ openbsd*) os=bsd need_tas=no ;;
+ dgux*) os=dgux need_tas=no ;;
+ aix*) os=aix need_tas=no ;;
+@@ -58,13 +54,6 @@
+ exit;;
+ esac
+
+-if test "X$elf" = "Xyes"
+-then
+- ELF_SYS=true
+-else
+- ELF_SYS=
+-fi
+-
+ if test "X$need_tas" = "Xyes"
+ then
+ AC_LINK_FILES(backend/port/tas/${tas_file}, backend/port/tas.s)
+@@ -416,6 +405,23 @@
+
+ LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
+ echo "- setting LDFLAGS=$LDFLAGS"
++
++dnl Check for ELF after finding compiler.
++case "X$elf" in
++Xmaybe)
++ if ${CC} -E - -dM </dev/null | grep -q __ELF__; then
++ ELF_SYS=true
++ else
++ ELF_SYS=
++ fi
++ ;;
++Xyes)
++ ELF_SYS=true
++ ;;
++*)
++ ELF_SYS=
++ ;;
++esac
+
+ AC_SUBST(ELF_SYS)
+ AC_SUBST(PORTNAME)
diff --git a/databases/postgresql/patches/patch-ai b/databases/postgresql/patches/patch-ai
new file mode 100644
index 00000000000..bf2e08acba1
--- /dev/null
+++ b/databases/postgresql/patches/patch-ai
@@ -0,0 +1,55 @@
+$NetBSD: patch-ai,v 1.3 1999/09/19 04:24:55 jlam Exp $
+
+--- ./configure.orig Sat May 29 20:06:44 1999
++++ ./configure Sat Sep 18 03:21:47 1999
+@@ -628,11 +628,7 @@
+ bsdi*) os=bsdi need_tas=no ;;
+ freebsd1*|freebsd2*) os=freebsd need_tas=no ;;
+ freebsd*) os=freebsd need_tas=no elf=yes ;;
+- netbsd*)
+- os=bsd need_tas=no
+- case "$host_cpu" in
+- powerpc) elf=yes ;;
+- esac ;;
++ netbsd*) os=bsd need_tas=no elf=maybe ;; # mix of a.out & ELF platforms
+ openbsd*) os=bsd need_tas=no ;;
+ dgux*) os=dgux need_tas=no ;;
+ aix*) os=aix need_tas=no ;;
+@@ -663,13 +659,6 @@
+ exit;;
+ esac
+
+-if test "X$elf" = "Xyes"
+-then
+- ELF_SYS=true
+-else
+- ELF_SYS=
+-fi
+-
+ if test "X$need_tas" = "Xyes"
+ then
+
+@@ -1418,6 +1407,23 @@
+
+ LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
+ echo "- setting LDFLAGS=$LDFLAGS"
++
++# Check for ELF after finding compiler.
++case "X$elf" in
++Xmaybe)
++ if ${CC} -E - -dM </dev/null | grep -q __ELF__; then
++ ELF_SYS=true
++ else
++ ELF_SYS=
++ fi
++ ;;
++Xyes)
++ ELF_SYS=true
++ ;;
++*)
++ ELF_SYS=
++ ;;
++esac
+
+
+
diff --git a/databases/postgresql/patches/patch-aj b/databases/postgresql/patches/patch-aj
new file mode 100644
index 00000000000..83a6357cbab
--- /dev/null
+++ b/databases/postgresql/patches/patch-aj
@@ -0,0 +1,25 @@
+$NetBSD: patch-aj,v 1.3 1999/09/19 04:24:55 jlam Exp $
+
+--- ./interfaces/ecpg/lib/Makefile.in.orig Wed Jun 30 19:57:23 1999
++++ ./interfaces/ecpg/lib/Makefile.in Sat Sep 18 03:05:04 1999
+@@ -12,7 +12,11 @@
+
+ NAME= ecpg
+ SO_MAJOR_VERSION= 3
++ifneq ($(LIBTOOL),)
++SO_MINOR_VERSION= 0 # bump this every time the patchlevel changes
++else
+ SO_MINOR_VERSION= 0.0
++endif
+
+ SRCDIR= @top_srcdir@
+ include $(SRCDIR)/Makefile.global
+@@ -25,7 +29,7 @@
+
+ OBJS= ecpglib.o typename.o
+
+-SHLIB_LINK= -L../../libpq -lpq
++SHLIB_LINK= $(LIBPQ)
+
+ # Shared library stuff, also default 'all' target
+ include $(SRCDIR)/Makefile.shlib
diff --git a/databases/postgresql/patches/patch-ak b/databases/postgresql/patches/patch-ak
new file mode 100644
index 00000000000..329cde1f32e
--- /dev/null
+++ b/databases/postgresql/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1 1999/09/19 04:24:55 jlam Exp $
+
+--- ./interfaces/libpgtcl/Makefile.in.orig Wed Jun 30 19:57:24 1999
++++ ./interfaces/libpgtcl/Makefile.in Sat Sep 18 03:05:39 1999
+@@ -27,7 +27,7 @@
+
+ OBJS= pgtcl.o pgtclCmds.o pgtclId.o
+
+-SHLIB_LINK+= -L../libpq -lpq
++SHLIB_LINK+= $(LIBPQ)
+
+ # If crypt is a separate library, rather than part of libc, it may need
+ # to be referenced separately to keep (broken) linkers happy. (This is
diff --git a/databases/postgresql/patches/patch-al b/databases/postgresql/patches/patch-al
new file mode 100644
index 00000000000..05dd089a90b
--- /dev/null
+++ b/databases/postgresql/patches/patch-al
@@ -0,0 +1,29 @@
+$NetBSD: patch-al,v 1.1 1999/09/19 04:24:55 jlam Exp $
+
+--- ./interfaces/libpq++/Makefile.in.orig Wed Jul 7 23:30:16 1999
++++ ./interfaces/libpq++/Makefile.in Sat Sep 18 03:08:44 1999
+@@ -17,8 +17,6 @@
+ SRCDIR= @top_srcdir@
+ include $(SRCDIR)/Makefile.global
+
+-CXX=@CXX@
+-
+ SRCHEADERDIR = $(SRCDIR)/include
+ LIBPQHEADERDIR = $(SRCHEADERDIR)/libpq
+
+@@ -43,10 +41,13 @@
+ OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o
+
+ ifeq ($(PORTNAME), win)
+-SHLIB_LINK+= --driver-name g++ -L../libpq -lpq
++SHLIB_LINK+= --driver-name g++ $(LIBPQ)
+ else
+-SHLIB_LINK= -L../libpq -lpq
++SHLIB_LINK= $(LIBPQ)
+ endif
++
++# Signify that we're building a C++ library.
++CXXLIB= true
+
+ # Shared library stuff, also default 'all' target
+ include $(SRCDIR)/Makefile.shlib
diff --git a/databases/postgresql/patches/patch-am b/databases/postgresql/patches/patch-am
new file mode 100644
index 00000000000..3e6f382297a
--- /dev/null
+++ b/databases/postgresql/patches/patch-am
@@ -0,0 +1,56 @@
+$NetBSD: patch-am,v 1.1 1999/09/19 04:24:55 jlam Exp $
+
+--- ./pl/plpgsql/src/Makefile.in.orig Wed Jun 30 19:57:31 1999
++++ ./pl/plpgsql/src/Makefile.in Sat Sep 18 03:10:58 1999
+@@ -27,7 +27,7 @@
+
+ OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
+
+-SHLIB_LINK+= -L$(LIBPQDIR) -lpq
++SHLIB_LINK+= -L$(LIBPQ)
+
+ # If crypt is a separate library, rather than part of libc, it may need
+ # to be referenced separately to keep (broken) linkers happy. (This is
+@@ -44,12 +44,20 @@
+ # installed, however, so we ignore the install-shlib rule and do this
+ # instead:
+
++ifneq ($(LIBTOOL),)
++install: install-lib post-install-lib
++
++post-install-lib:
++ rm -f $(LIBDIR)/lib$(NAME).a
++ $(LN_S) -f $(LIBDIR)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) $(LIBDIR)/plpgsql$(DLSUFFIX)
++else
+ install: $(shlib)
+ ifneq ($(shlib),)
+ $(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/plpgsql$(DLSUFFIX)
+ else
+ @echo "plpgsql not installed due to lack of shared library support."
+ endif
++endif
+
+
+ pl_handler.o: pl_handler.c plpgsql.h pl.tab.h
+@@ -60,8 +68,10 @@
+
+ pl_funcs.o: pl_funcs.c plpgsql.h pl.tab.h
+
+-pl_parse.o: pl_gram.c pl_scan.c plpgsql.h
+- $(CC) $(CFLAGS) -c -o $@ pl_gram.c
++pl_parse.o: pl_parse.c plpgsql.h pl.tab.h
++
++pl_parse.c: pl_gram.c pl_scan.c plpgsql.h
++ $(LN_S) -f pl_gram.c pl_parse.c
+
+ pl_gram.c pl.tab.h: gram.y
+ $(YACC) $(YFLAGS) $<
+@@ -79,7 +89,7 @@
+
+ clean: clean-shlib
+ rm -f lib$(NAME).a
+- rm -f *.o pl.tab.h pl_gram.c pl_scan.c
++ rm -f *.o pl.tab.h pl_parse.c pl_gram.c pl_scan.c
+ # And the garbage that might have been left behind by partial build:
+ rm -f y.tab.c y.tab.h lex.yy.c
+ ifeq ($(PORTNAME), win)