*** ./GNUmakefile.in.orig	Tue Apr 20 09:35:41 2004
--- ./GNUmakefile.in	Mon May 24 15:50:27 2004
***************
*** 13,30 ****
  	$(MAKE) -C src all
  	@echo "All of PostgreSQL successfully made. Ready to install."
  
! install:
  	$(MAKE) -C doc install
  	$(MAKE) -C src install
- 	@echo "PostgreSQL installation complete."
  
  installdirs uninstall distprep:
  	$(MAKE) -C doc $@
  	$(MAKE) -C src $@
  
  install-all-headers:
  	$(MAKE) -C src $@
  
  # clean, distclean, etc should apply to contrib too, even though
  # it's not built by default
  clean:
--- 13,55 ----
  	$(MAKE) -C src all
  	@echo "All of PostgreSQL successfully made. Ready to install."
  
! install: light-install install-all-headers install-config-files
! 	@echo "PostgreSQL installation complete."
! 
! light-install:
  	$(MAKE) -C doc install
  	$(MAKE) -C src install
  
  installdirs uninstall distprep:
  	$(MAKE) -C doc $@
  	$(MAKE) -C src $@
  
+ uninstall: uninstall-local
+ 
+ uninstall-local:
+ 	$(RM) $(DESTDIR)$(insbuilddir)/* $(DESTDIR)$(insbuilddir)/config/*
+ 
  install-all-headers:
  	$(MAKE) -C src $@
  
+ install-config-files: installdirs
+ 	$(MAKE) -C src $@
+ 	$(INSTALL_DATA) config.status $(DESTDIR)$(insbuilddir)
+ 	$(INSTALL_DATA) config/install-sh $(DESTDIR)$(insbuilddir)/config
+ 	$(INSTALL_DATA) config/mkinstalldirs $(DESTDIR)$(insbuilddir)/config
+ 
+ installdirs: installdirs-local
+ 
+ installdirs-local:
+ 	$(mkinstalldirs) $(DESTDIR)$(insbuilddir)
+ 	$(mkinstalldirs) $(DESTDIR)$(insbuilddir)/config
+ 
+ install-client-only:
+ 	$(MAKE) -C src/bin install
+ 	$(MAKE) -C src/include install
+ 	$(MAKE) -C src/interfaces install
+ 	$(MAKE) -C doc install
+ 
  # clean, distclean, etc should apply to contrib too, even though
  # it's not built by default
  clean:
*** ./configure.in.orig	Mon May 24 11:26:23 2004
--- ./configure.in	Mon May 24 15:32:24 2004
***************
*** 128,133 ****
--- 128,144 ----
  
  
  #
+ # Installation directory for build utilities
+ #
+ PGAC_ARG(with, insbuilddir, 
+         [  --with-insbuilddir=DIR  install build utilities in DIR [[LIBDIR/build]]], 
+ 	[AC_MSG_ERROR([option --with-insbuilddir requires an argument])],
+ 	[AC_MSG_ERROR([option --without-insbuilddir does not apply])], 
+ 	[insbuilddir=$withval],
+ 	[insbuilddir='${libdir}/build'])
+ AC_SUBST(insbuilddir)
+ 
+ #
  # Add non-standard directories to the library search path
  #
  PGAC_ARG_REQ(with, libraries, [  --with-libraries=DIRS   look for additional libraries in DIRS],
*** ./contrib/btree_gist/Makefile.pgxs.orig	Mon May 24 15:35:03 2004
--- ./contrib/btree_gist/Makefile.pgxs	Mon May 24 15:51:18 2004
***************
*** 0 ****
--- 1,28 ----
+ # local configuration
+ MODULE_big = btree_gist
+ OBJS= btree_common.o btree_int2.o btree_int4.o btree_int8.o btree_float4.o btree_float8.o btree_ts.o
+ DATA_built = btree_gist.sql
+ DOCS = README.btree_gist
+ REGRESS = btree_gist
+ 
+ EXTRA_CLEAN = btree_int2.c btree_int4.c btree_int8.c btree_float4.c btree_float8.c 
+ 
+ # generic settings
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ # local rules
+ btree_int2.c: btree_num.c.in
+ 	sed 's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT2,g;s,__BTREE_GIST_TYPE__,int16,g;s,__BTREE_GIST_TYPE2__,int2,g' < $<  > $@
+ 
+ btree_int4.c: btree_num.c.in
+ 	sed 's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT4,g;s,__BTREE_GIST_TYPE__,int32,g;s,__BTREE_GIST_TYPE2__,int4,g' < $<  > $@
+ 
+ btree_int8.c: btree_num.c.in
+ 	sed 's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT8,g;s,__BTREE_GIST_TYPE__,int64,g;s,__BTREE_GIST_TYPE2__,int8,g' < $<  > $@
+ 
+ btree_float4.c: btree_num.c.in
+ 	sed 's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_FLOAT4,g;s,__BTREE_GIST_TYPE__,float4,g;s,__BTREE_GIST_TYPE2__,float4,g' < $<  > $@
+ 
+ btree_float8.c: btree_num.c.in
+ 	sed 's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_FLOAT8,g;s,__BTREE_GIST_TYPE__,float8,g;s,__BTREE_GIST_TYPE2__,float8,g' < $<  > $@
*** ./contrib/chkpass/Makefile.pgxs.orig	Mon May 24 15:56:33 2004
--- ./contrib/chkpass/Makefile.pgxs	Mon May 24 15:56:18 2004
***************
*** 0 ****
--- 1,12 ----
+ # local conf
+ MODULE_big = chkpass
+ OBJS = chkpass.o
+ SHLIB_LINK = $(filter -lcrypt, $(LIBS))
+ DATA_built = chkpass.sql
+ DOCS = README.chkpass
+ 
+ # global
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ # local rules
*** ./contrib/cube/Makefile.pgxs.orig	Mon May 24 15:32:24 2004
--- ./contrib/cube/Makefile.pgxs	Mon May 24 15:32:24 2004
***************
*** 0 ****
--- 1,35 ----
+ # generic macros
+ MODULE_big = cube
+ OBJS= cube.o cubeparse.o
+ 
+ DATA_built = cube.sql
+ DOCS = README.cube
+ REGRESS = cube
+ 
+ EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
+ 
+ # postgresql extensions
+ PGXS := $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ # specific rules
+ # cubescan is compiled as part of cubeparse
+ cubeparse.o: cubescan.c
+ 
+ cubeparse.c: cubeparse.h ;
+ 
+ cubeparse.h: cubeparse.y
+ ifdef YACC
+ 	$(YACC) -d $(YFLAGS) -p cube_yy $<
+ 	mv -f y.tab.c cubeparse.c
+ 	mv -f y.tab.h cubeparse.h
+ else
+ 	@$(missing) bison $< $@
+ endif
+ 
+ cubescan.c: cubescan.l
+ ifdef FLEX
+ 	$(FLEX) $(FLEXFLAGS) -o'$@' $<
+ else
+ 	@$(missing) flex $< $@
+ endif
*** ./contrib/dbase/Makefile.pgxs.orig	Mon May 24 15:57:12 2004
--- ./contrib/dbase/Makefile.pgxs	Mon May 24 15:58:04 2004
***************
*** 0 ****
--- 1,18 ----
+ # local configuration
+ PROGRAM = dbf2pg
+ OBJS	= dbf.o dbf2pg.o endian.o
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ PG_LIBS = $(libpq)
+ 
+ # Uncomment this to provide charset translation
+ #PG_CPPFLAGS += -DHAVE_ICONV_H
+ # You might need to uncomment this too, if libiconv is a separate
+ # library on your platform
+ #PG_LIBS += -liconv
+ 
+ DOCS = README.dbf2pg
+ MAN = dbf2pg.1			# XXX not implemented
+ 
+ # global
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/dblink/Makefile.pgxs.orig	Mon May 24 15:58:32 2004
--- ./contrib/dblink/Makefile.pgxs	Mon May 24 16:00:13 2004
***************
*** 0 ****
--- 1,11 ----
+ MODULE_big = dblink
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ OBJS	= dblink.o
+ SHLIB_LINK = $(libpq)
+ 
+ DATA_built = dblink.sql 
+ DOCS = README.dblink
+ REGRESS = dblink
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/dbsize/Makefile.pgxs.orig	Mon May 24 16:01:07 2004
--- ./contrib/dbsize/Makefile.pgxs	Mon May 24 16:01:37 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = dbsize
+ DATA_built = dbsize.sql
+ DOCS = README.dbsize
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/earthdistance/Makefile.pgxs.orig	Mon May 24 16:02:51 2004
--- ./contrib/earthdistance/Makefile.pgxs	Mon May 24 16:03:17 2004
***************
*** 0 ****
--- 1,7 ----
+ MODULES = earthdistance
+ DATA_built = earthdistance.sql
+ DOCS = README.earthdistance
+ REGRESS = earthdistance
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/findoidjoins/Makefile.pgxs.orig	Mon May 24 16:04:02 2004
--- ./contrib/findoidjoins/Makefile.pgxs	Mon May 24 16:05:00 2004
***************
*** 0 ****
--- 1,11 ----
+ PROGRAM = findoidjoins
+ OBJS	= findoidjoins.o
+ 
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ PG_LIBS = $(libpq)
+ 
+ SCRIPTS = make_oidjoins_check
+ DOCS = README.findoidjoins
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/fulltextindex/Makefile.pgxs.orig	Mon May 24 16:06:23 2004
--- ./contrib/fulltextindex/Makefile.pgxs	Mon May 24 16:06:49 2004
***************
*** 0 ****
--- 1,7 ----
+ MODULES = fti
+ DATA_built = fti.sql
+ DOCS = README.fti
+ SCRIPTS = fti.pl
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/fuzzystrmatch/Makefile.pgxs.orig	Mon May 24 16:07:07 2004
--- ./contrib/fuzzystrmatch/Makefile.pgxs	Mon May 24 16:07:31 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = fuzzystrmatch
+ DATA_built = fuzzystrmatch.sql
+ DOCS = README.fuzzystrmatch README.soundex
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/intagg/Makefile.pgxs.orig	Mon May 24 16:08:23 2004
--- ./contrib/intagg/Makefile.pgxs	Mon May 24 16:08:51 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = int_aggregate
+ DATA_built = int_aggregate.sql
+ DOCS = README.int_aggregate
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/intarray/Makefile.pgxs.orig	Mon May 24 16:09:18 2004
--- ./contrib/intarray/Makefile.pgxs	Mon May 24 16:09:41 2004
***************
*** 0 ****
--- 1,8 ----
+ MODULE_big = _int
+ OBJS = _int_bool.o _int_gist.o _int_op.o _int_tool.o _intbig_gist.o 
+ DATA_built = _int.sql
+ DOCS = README.intarray
+ REGRESS = _int
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/isbn_issn/Makefile.pgxs.orig	Mon May 24 15:32:24 2004
--- ./contrib/isbn_issn/Makefile.pgxs	Mon May 24 15:32:24 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = isbn_issn
+ DATA_built = isbn_issn.sql
+ DOCS = README.isbn_issn
+ 
+ PGXS := $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/lo/Makefile.pgxs.orig	Mon May 24 16:10:39 2004
--- ./contrib/lo/Makefile.pgxs	Mon May 24 16:10:59 2004
***************
*** 0 ****
--- 1,7 ----
+ MODULES = lo
+ DATA_built = lo.sql
+ DATA = lo_drop.sql lo_test.sql
+ DOCS = README.lo
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/ltree/Makefile.pgxs.orig	Mon May 24 16:11:25 2004
--- ./contrib/ltree/Makefile.pgxs	Mon May 24 16:11:48 2004
***************
*** 0 ****
--- 1,10 ----
+ PG_CPPFLAGS = -DLOWER_NODE
+ MODULE_big = ltree
+ OBJS = 	ltree_io.o ltree_op.o lquery_op.o _ltree_op.o crc32.o \
+ 	ltxtquery_io.o ltxtquery_op.o ltree_gist.o _ltree_gist.o
+ DATA_built = ltree.sql
+ DOCS = README.ltree
+ REGRESS = ltree
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/mSQL-interface/Makefile.pgxs.orig	Mon May 24 16:12:58 2004
--- ./contrib/mSQL-interface/Makefile.pgxs	Mon May 24 16:14:30 2004
***************
*** 0 ****
--- 1,9 ----
+ PROGRAM	= mpgsql
+ SO_MAJOR_VERSION = 0
+ SO_MINOR_VERSION = 0
+ OBJS	= mpgsql.o
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
*** ./contrib/miscutil/Makefile.pgxs.orig	Mon May 24 16:15:19 2004
--- ./contrib/miscutil/Makefile.pgxs	Mon May 24 16:15:50 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = misc_utils
+ DATA_built = misc_utils.sql
+ DOCS = README.misc_utils
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/noupdate/Makefile.pgxs.orig	Mon May 24 16:16:23 2004
--- ./contrib/noupdate/Makefile.pgxs	Mon May 24 16:19:11 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = noup
+ DATA_built = noup.sql
+ DOCS = README.noup
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/oid2name/Makefile.pgxs.orig	Mon May 24 16:20:44 2004
--- ./contrib/oid2name/Makefile.pgxs	Mon May 24 16:21:23 2004
***************
*** 0 ****
--- 1,8 ----
+ PROGRAM = oid2name
+ OBJS	= oid2name.o
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ PG_LIBS = $(libpq)
+ DOCS = README.oid2name
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/pg_autovacuum/Makefile.pgxs.orig	Mon May 24 15:32:24 2004
--- ./contrib/pg_autovacuum/Makefile.pgxs	Mon May 24 15:32:24 2004
***************
*** 0 ****
--- 1,10 ----
+ PROGRAM = pg_autovacuum
+ OBJS	= pg_autovacuum.o
+ 
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ PG_LIBS = $(libpq)
+ 
+ DOCS = README.pg_autovacuum
+ 
+ PGXS := $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/pg_dumplo/Makefile.pgxs.orig	Mon May 24 16:22:18 2004
--- ./contrib/pg_dumplo/Makefile.pgxs	Mon May 24 16:22:36 2004
***************
*** 0 ****
--- 1,8 ----
+ PROGRAM = pg_dumplo
+ OBJS	= main.o lo_export.o lo_import.o utils.o
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ PG_LIBS = $(libpq)
+ DOCS = README.pg_dumplo
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/pg_logger/Makefile.pgxs.orig	Mon May 24 16:23:00 2004
--- ./contrib/pg_logger/Makefile.pgxs	Mon May 24 16:23:27 2004
***************
*** 0 ****
--- 1,6 ----
+ PROGRAM = pg_logger
+ OBJS	= pg_logger.o
+ DOCS = README.pg_logger
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/pgbench/Makefile.pgxs.orig	Mon May 24 16:23:55 2004
--- ./contrib/pgbench/Makefile.pgxs	Mon May 24 16:24:20 2004
***************
*** 0 ****
--- 1,8 ----
+ PROGRAM = pgbench
+ OBJS	= pgbench.o
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ PG_LIBS = $(libpq)
+ DOCS = README.pgbench README.pgbench_jis
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/pgcrypto/Makefile.pgxs.orig	Mon May 24 16:24:45 2004
--- ./contrib/pgcrypto/Makefile.pgxs	Mon May 24 16:25:48 2004
***************
*** 0 ****
--- 1,79 ----
+ # either 'builtin', 'mhash', 'openssl'
+ cryptolib = builtin
+ 
+ # either 'builtin', 'system'
+ cryptsrc = builtin
+ 
+ # Random source, preferred order:
+ # 'dev'      - read from random device
+ #
+ # 'openssl'  - use openssl PRNG.
+ #              Note that currently pgcrypto does not do any
+ #              entropy feeding to it
+ #              This works ofcouse only with cryptolib = openssl
+ #
+ # 'silly'    - use libc random() - very weak
+ random = silly
+ random_dev = \"/dev/urandom\"
+ 
+ ##########################
+ 
+ ifeq ($(cryptolib), builtin)
+ CRYPTO_CFLAGS =
+ CRYPTO_LDFLAGS =
+ SRCS = md5.c sha1.c internal.c blf.c rijndael.c
+ endif
+ 
+ ifeq ($(cryptolib), openssl)
+ CRYPTO_CFLAGS = -I/usr/include/openssl
+ CRYPTO_LDFLAGS = -lcrypto
+ SRCS = openssl.c
+ endif
+ 
+ ifeq ($(cryptolib), mhash)
+ CRYPTO_CFLAGS = -I/usr/local/include
+ CRYPTO_LDFLAGS = -L/usr/local/lib -lmcrypt -lmhash -lltdl
+ SRCS = mhash.c
+ endif
+ 
+ ifeq ($(cryptsrc), builtin)
+ SRCS += crypt-blowfish.c crypt-des.c crypt-md5.c 
+ else
+ CRYPTO_CFLAGS += -DPX_SYSTEM_CRYPT
+ endif
+ 
+ ifeq ($(random), dev)
+ CRYPTO_CFLAGS += -DRAND_DEV=$(random_dev)
+ endif
+ ifeq ($(random), openssl)
+ CRYPTO_CFLAGS += -DRAND_OPENSSL
+ endif
+ ifeq ($(random), silly)
+ CRYPTO_CFLAGS += -DRAND_SILLY
+ endif
+ 
+ MODULE_big	:= pgcrypto
+ SRCS		+= pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \
+ 			crypt-gensalt.c random.c
+ OBJS		:= $(SRCS:.c=.o)
+ DOCS		:= README.pgcrypto
+ DATA_built	:= pgcrypto.sql
+ EXTRA_CLEAN	:= gen-rtab
+ 
+ PG_CPPFLAGS	:= $(CRYPTO_CFLAGS) -I$(srcdir) 
+ SHLIB_LINK 	:= $(CRYPTO_LDFLAGS)
+ 
+ REGRESS := init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
+ 		crypt-des crypt-md5 crypt-blowfish crypt-xdes 
+ 
+ # global
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ # local rules
+ rijndael.o: rijndael.tbl
+ 
+ rijndael.tbl:
+ 	$(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
+ 	./gen-rtab > rijndael.tbl
+ 
*** ./contrib/pgstattuple/Makefile.pgxs.orig	Mon May 24 16:27:22 2004
--- ./contrib/pgstattuple/Makefile.pgxs	Mon May 24 16:27:53 2004
***************
*** 0 ****
--- 1,11 ----
+ MODULE_big	:= pgstattuple
+ SRCS		+= pgstattuple.c
+ OBJS		:= $(SRCS:.c=.o)
+ DOCS		:= README.pgstattuple README.pgstattuple.euc_jp
+ DATA_built	:= pgstattuple.sql
+ 
+ PG_CPPFLAGS	:=
+ SHLIB_LINK 	:=
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/rserv/Makefile.pgxs.orig	Mon May 24 16:28:23 2004
--- ./contrib/rserv/Makefile.pgxs	Mon May 24 16:28:55 2004
***************
*** 0 ****
--- 1,25 ----
+ NAME	= rserv
+ MODULES	= rserv
+ DATA	= RServ.pm
+ DATA_built	= master.sql slave.sql
+ SQLS	= $(DATA_built)
+ DOCS	= README.rserv
+ SCRIPTS_built	= RservTest
+ SCRIPTS_built	+= MasterInit MasterAddTable Replicate MasterSync CleanLog
+ SCRIPTS_built	+= SlaveInit SlaveAddTable GetSyncID
+ SCRIPTS_built	+= PrepareSnapshot ApplySnapshot
+ SCRIPTS_built	+= InitRservTest
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ 
+ $(SQLS): %.sql: %.sql.in
+ 	sed 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' $< >$@
+ 
+ $(SCRIPTS_built): %: %.in
+ 	sed -e 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' \
+ 	    -e 's:@SQLDIR@:$(datadir)/contrib:g' \
+ 	    -e 's:@BINDIR@:$(bindir):g' \
+ 	    -e 's:@LIBDIR@:$(datadir)/contrib:g' $< >$@
+ 	chmod a+x $@
*** ./contrib/rtree_gist/Makefile.pgxs.orig	Mon May 24 16:29:28 2004
--- ./contrib/rtree_gist/Makefile.pgxs	Mon May 24 16:29:55 2004
***************
*** 0 ****
--- 1,7 ----
+ MODULES = rtree_gist
+ DATA_built = rtree_gist.sql
+ DOCS = README.rtree_gist
+ REGRESS = rtree_gist
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/seg/Makefile.pgxs.orig	Mon May 24 16:30:18 2004
--- ./contrib/seg/Makefile.pgxs	Mon May 24 16:30:51 2004
***************
*** 0 ****
--- 1,32 ----
+ MODULE_big = seg
+ OBJS = seg.o segparse.o
+ DATA_built = seg.sql
+ DOCS = README.seg
+ REGRESS = seg
+ EXTRA_CLEAN = segparse.c segparse.h segscan.c y.tab.c y.tab.h
+ 
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ 
+ # segscan is compiled as part of segparse
+ segparse.o: segscan.c
+ 
+ segparse.c: segparse.h ;
+ 
+ segparse.h: segparse.y
+ ifdef YACC
+ 	$(YACC) -d $(YFLAGS) -p seg_yy $<
+ 	mv -f y.tab.c segparse.c
+ 	mv -f y.tab.h segparse.h
+ else
+ 	@$(missing) bison $< $@
+ endif
+ 
+ segscan.c: segscan.l
+ ifdef FLEX
+ 	$(FLEX) $(FLEXFLAGS) -o'$@' $<
+ else
+ 	@$(missing) flex $< $@
+ endif
*** ./contrib/spi/Makefile.pgxs.orig	Mon May 24 16:31:24 2004
--- ./contrib/spi/Makefile.pgxs	Mon May 24 16:31:48 2004
***************
*** 0 ****
--- 1,11 ----
+ MODULES = autoinc insert_username moddatetime refint timetravel
+ DATA_built = $(addsuffix .sql, $(MODULES))
+ DOCS	= README.spi $(addsuffix .example, $(MODULES))
+ 
+ # this is needed for the regression tests;
+ # comment out if you want a quieter refint package for other uses
+ PG_CPPFLAGS = -DREFINT_VERBOSE
+ 
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/string/Makefile.pgxs.orig	Mon May 24 16:32:15 2004
--- ./contrib/string/Makefile.pgxs	Mon May 24 16:32:34 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = string_io
+ DATA_built = string_io.sql
+ DOCS = README.string_io
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/tablefunc/Makefile.pgxs.orig	Mon May 24 16:32:56 2004
--- ./contrib/tablefunc/Makefile.pgxs	Mon May 24 16:33:16 2004
***************
*** 0 ****
--- 1,7 ----
+ MODULES = tablefunc
+ DATA_built = tablefunc.sql
+ DOCS = README.tablefunc
+ REGRESS = tablefunc
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/tips/Makefile.pgxs.orig	Mon May 24 16:33:45 2004
--- ./contrib/tips/Makefile.pgxs	Mon May 24 16:34:01 2004
***************
*** 0 ****
--- 1,4 ----
+ DOCS = README.apachelog
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/tsearch/Makefile.pgxs.orig	Mon May 24 16:34:27 2004
--- ./contrib/tsearch/Makefile.pgxs	Mon May 24 16:35:10 2004
***************
*** 0 ****
--- 1,24 ----
+ PG_CPPFLAGS = -I.
+ MODULE_big = tsearch
+ OBJS = crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o
+ DATA_built = tsearch.sql
+ DOCS = README.tsearch
+ REGRESS = tsearch
+ EXTRA_CLEAN = parser.c
+ 
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ 
+ # parser is compiled as part of query
+ query.o: parser.c
+ 
+ parser.c: parser.l
+ ifdef FLEX
+ 	$(FLEX) $(FLEXFLAGS) -8 -Ptsearch_yy -o'$@' $<
+ else
+ 	@$(missing) flex $< $@
+ endif
+ 
+ # DO NOT DELETE
*** ./contrib/tsearch2/Makefile.pgxs.orig	Mon May 24 15:32:24 2004
--- ./contrib/tsearch2/Makefile.pgxs	Mon May 24 15:32:24 2004
***************
*** 0 ****
--- 1,43 ----
+ MODULE_big = tsearch2
+ OBJS = dict_ex.o dict.o snmap.o stopword.o common.o prs_dcfg.o \
+        dict_snowball.o dict_ispell.o dict_syn.o \
+        wparser.o wparser_def.o \
+        ts_cfg.o tsvector.o rewrite.o crc32.o query.o gistidx.o \
+        tsvector_op.o rank.o ts_stat.o
+ 
+ SUBDIRS     := snowball ispell wordparser
+ SUBDIROBJS  := $(SUBDIRS:%=%/SUBSYS.o)
+ 
+ OBJS:= $(OBJS) $(SUBDIROBJS)
+ 
+ $(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
+ 
+ $(SUBDIRS:%=%-recursive):
+ 	$(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
+ 
+ PG_CPPFLAGS = -I$(srcdir)/snowball -I$(srcdir)/ispell -I$(srcdir)/wordparser
+ 
+ DATA = stopword/english.stop stopword/russian.stop
+ DATA_built = tsearch2.sql untsearch2.sql
+ DOCS = README.tsearch2
+ REGRESS = tsearch2
+ 
+ SHLIB_LINK := -lm
+ 
+ #
+ PGXS := $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ # specific rules
+ tsearch2.sql: tsearch.sql.in
+ 	sed -e 's,MODULE_PATHNAME,$$libdir/$(MODULE_big),g' \
+ 	    -e 's,DATA_PATH,$(datadir)/contrib,g' $< >$@
+ 
+ untsearch2.sql: untsearch.sql.in
+ 	cp $< $@
+ 
+ .PHONY: subclean
+ clean: subclean
+ 
+ subclean:
+ 	for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean || exit; done
*** ./contrib/userlock/Makefile.pgxs.orig	Mon May 24 16:40:17 2004
--- ./contrib/userlock/Makefile.pgxs	Mon May 24 16:40:36 2004
***************
*** 0 ****
--- 1,6 ----
+ MODULES = user_locks
+ DATA_built = user_locks.sql
+ DOCS = README.user_locks
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/xml/Makefile.pgxs.orig	Mon May 24 16:41:02 2004
--- ./contrib/xml/Makefile.pgxs	Mon May 24 16:41:22 2004
***************
*** 0 ****
--- 1,9 ----
+ MODULE_big = pgxml_dom
+ OBJS = pgxml_dom.o
+ SHLIB_LINK = -lxml2
+ DATA_built = pgxml_dom.sql
+ DOCS = README.xml
+ 
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./contrib/xml2/Makefile.pgxs.orig	Mon May 24 16:42:01 2004
--- ./contrib/xml2/Makefile.pgxs	Mon May 24 16:42:49 2004
***************
*** 0 ****
--- 1,11 ----
+ MODULE_big = pgxml
+ # Remove xslt_proc.o from the following line if you don't have libxslt
+ OBJS = xpath.o xslt_proc.o
+ # Remove -lxslt from the following line if you don't have libxslt.
+ SHLIB_LINK = -lxml2 -lxslt
+ DATA_built = pgxml.sql
+ DOCS = README.xml2
+ 
+ 
+ PGXS	:= $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
*** ./doc/src/sgml/installation.sgml.orig	Mon May 24 11:26:26 2004
--- ./doc/src/sgml/installation.sgml	Mon May 24 15:32:24 2004
***************
*** 596,601 ****
--- 596,613 ----
        
  
        
+       
+        
+         
+ 	 Useful files for building PostgreSQL
+ 	 extensions, such as makefiles or scripts, will be installed in this
+ 	 directory.
+ 	 The default is LIBDIR/build
+ 	
+        
+       
+ 
+       
         
         
         
***************
*** 1042,1071 ****
     
  
     
!     The standard installation provides only the header files needed for client
!     application development.  If you plan to do any server-side program
!     development (such as custom functions or data types written in C),
!     then you may want to install the entire PostgreSQL>
!     include tree into your target include directory.  To do that, enter
  
! gmake install-all-headers
  
!     This adds a megabyte or two to the installation footprint, and is only
!     useful if you don't plan to keep the whole source tree around for
!     reference.  (If you do, you can just use the source's include
!     directory when building server-side software.)
     
  
     
      Client-only installation:
      
       If you want to install only the client applications and
!      interface libraries, then you can use these commands:
  
! gmake -C src/bin install>
! gmake -C src/include install>
! gmake -C src/interfaces install>
! gmake -C doc install>
  
      
     
--- 1054,1080 ----
     
  
     
!     The standard installation provides all the header files needed for client
!     application development, as well as headers for server-side program
!     development such as custom functions or data types written in C.
!     If you do not want to install the entire PostgreSQL>
!     include tree into your target include directory.  Enter
  
! gmake light-install
  
!     rather than the install target.
!     This reduce by two megabytes the installation footprint, at the price
!     of having to recover the whole source tree if you need
!     to add extensions such as new data types or custom functions.
     
  
     
      Client-only installation:
      
       If you want to install only the client applications and
!      interface libraries, then you can use these command:
  
! gmake install-client-only>
  
      
     
*** ./doc/src/sgml/pgxs.sgml.orig	Mon May 24 16:53:11 2004
--- ./doc/src/sgml/pgxs.sgml	Mon May 24 17:14:34 2004
***************
*** 0 ****
--- 1,64 ----
+ 
+ 
+ 
+ PostgreSQL extension build infrastructure
+ 
+ 
+ 
+ 
+ pgxs
+ 
+ 
+ extending PostgreSQL
+ 
+ 
+ 
+ This section describes the PostgreSQL
+ build infrastructure for extensions, so that new contributions
+ can be built simply against an already installed server.
+ 
+ Such contributions include: new types, functions, gist-based
+ indexes, and so on.
+ 
+ Extensions can be compiled and installed as if it would have
+ been directly done during server installation, by reusing
+ postgresql build infrastructure.
+ 
+ 
+ 
+ How to use PostgreSQL extension
+ build infrastructure
+ 
+ 
+ In order to use the infrastructure for your extension, you must 
+ use a specific makefile and tailor it to your needs. 
+ A ready to use makefile template is available under directory 
+ pg_config --pgxs,
+ file Makefile.pgxs.
+ 
+ 
+ 
+ Copy this makefile as Makefile in the directory 
+ which holds your extension. Comments in this makefile indicates 
+ which macros can be set and which effect is to be expected. 
+ Then you can do make to compile, and later
+ make install to install your contribution.
+ 
+ 
+ 
+ The extension is compiled and installed for the 
+ PostgreSQL which correspond to the
+ first pg_config command found in your 
+ PATH.
+ 
+ 
+ 
+ Many examples of such tailored makefiles, named
+ Makefile.pgxs, can be found in
+ contrib/ subdirectories. They can be used
+ with make -f Makefile.pgxs ....
+ 
+ 
+ 
*** ./src/Makefile.global.in.orig	Mon May 24 11:26:27 2004
--- ./src/Makefile.global.in	Mon May 24 15:32:24 2004
***************
*** 116,121 ****
--- 116,122 ----
  
  localedir := @localedir@
  
+ insbuilddir := @insbuilddir@
  
  ##########################################################################
  #
***************
*** 166,172 ****
--- 167,179 ----
  
  CPP = @CPP@
  CPPFLAGS = @CPPFLAGS@
+ 
+ ifdef PGXS
+ override CPPFLAGS := -I$(includedir_server) -I$(includedir_internal) -I$(includedir) $(CPPFLAGS)
+ else
  override CPPFLAGS := -I$(top_srcdir)/src/include $(CPPFLAGS)
+ endif
+ 
  ifdef VPATH
  override CPPFLAGS := -I$(top_builddir)/src/include $(CPPFLAGS)
  endif
***************
*** 198,203 ****
--- 205,215 ----
  LORDER = @LORDER@
  X = @EXEEXT@
  
+ ifdef PGXS
+ LDFLAGS += -L$(pkglibdir) -L$(libdir)
+ endif
+ 
+ 
  # Perl 
  
  PERL			= @PERL@
***************
*** 366,371 ****
--- 378,386 ----
  %.bz2: %
  	$(BZIP2) -f $<
  
+ 
+ ifndef PGXS
+ 
  # Remake Makefile.global from Makefile.global.in if the latter
  # changed. In order to trigger this rule, the including file must
  # write `include $(top_builddir)/src/Makefile.global', not some
***************
*** 393,398 ****
--- 408,414 ----
  $(top_builddir)/config.status: $(top_srcdir)/configure
  	cd $(top_builddir) && ./config.status --recheck
  
+ endif
  
  install-strip:
  	@$(MAKE) INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'" \
*** ./src/Makefile.orig	Fri Apr 30 17:18:16 2004
--- ./src/Makefile	Mon May 24 15:49:50 2004
***************
*** 26,31 ****
--- 26,53 ----
  install-all-headers:
  	$(MAKE) -C include $@
  
+ install-config-files: installdirs
+ 	$(MAKE) -C utils $@
+ 	$(MAKE) -C makefiles $@
+ 	$(MAKE) -C port $@
+ 	for f in Makefile.global Makefile.port Makefile.shlib nls-global.mk ; \
+ 	do \
+ 	  	$(INSTALL_DATA) $$f $(DESTDIR)$(insbuilddir)/src ; \
+ 	done
+ 
+ uninstall: uninstall-local
+ 
+ uninstall-local:
+ 	$(MAKE) -C utils $@
+ 	$(MAKE) -C makefiles $@
+ 	$(RM) $(DESTDIR)$(insbuilddir)/* $(DESTDIR)$(insbuilddir)/src/*
+ 
+ installdirs: installdirs-local
+ 
+ installdirs-local:
+ 	$(mkinstalldirs) $(DESTDIR)$(insbuilddir)
+ 	$(mkinstalldirs) $(DESTDIR)$(insbuilddir)/src
+ 
  clean:
  	$(MAKE) -C port $@
  	$(MAKE) -C timezone $@
*** ./src/bin/pg_config/Makefile.orig	Sat Nov 29 20:52:04 2003
--- ./src/bin/pg_config/Makefile	Mon May 24 15:32:24 2004
***************
*** 14,19 ****
--- 14,20 ----
  	    -e 's,@pkglibdir@,$(pkglibdir),g' \
  	    -e "s|@configure@|$(configure_args)|g" \
  	    -e 's,@version@,$(VERSION),g' \
+ 	    -e 's,@insbuilddir@,$(insbuilddir),g' \
  	  $< >$@
  	chmod a+x $@
  
*** ./src/bin/pg_config/pg_config.sh.orig	Sat Nov 29 20:52:04 2003
--- ./src/bin/pg_config/pg_config.sh	Mon May 24 15:32:24 2004
***************
*** 19,24 ****
--- 19,25 ----
  val_pkglibdir='@pkglibdir@'
  val_configure="@configure@"
  val_version='@version@'
+ val_insbuilddir='@insbuilddir@'
  
  help="\
  $me provides information about the installed version of PostgreSQL.
***************
*** 35,40 ****
--- 36,43 ----
    --pkglibdir           show location of dynamically loadable modules
    --configure           show options given to 'configure' script when
                          PostgreSQL was built
+   --insbuilddir         show location of files for building extensions
+   --pgxs		show location of extension directory
    --version             show the PostgreSQL version, then exit
    --help                show this help, then exit
  
***************
*** 61,66 ****
--- 64,71 ----
          --libdir)       show="$show \$val_libdir";;
          --pkglibdir)    show="$show \$val_pkglibdir";;
          --configure)    show="$show \$val_configure";;
+ 	--insbuilddir)  show="$show \$val_insbuilddir";;
+ 	--pgxs)         show="$show \$val_insbuilddir/src/makefiles";;
  
  	--version)      echo "PostgreSQL $val_version"
                          exit 0;;
*** ./src/makefiles/Makefile.orig	Mon May 24 15:32:24 2004
--- ./src/makefiles/Makefile	Mon May 24 15:32:24 2004
***************
*** 0 ****
--- 1,17 ----
+ # Makefile for src/makefiles
+ 
+ subdir = src/makefiles
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ 
+ install-config-files: installdirs
+ 	for f in Makefile.* *.mk ; do \
+ 	  $(INSTALL_DATA) $$f $(DESTDIR)$(insbuilddir)/$(subdir) ; \
+ 	done
+ 	$(INSTALL_DATA) Makefile.pgxs $(DESTDIR)$(insbuilddir)
+ 
+ installdirs:
+ 	$(mkinstalldirs) $(DESTDIR)$(insbuilddir)/$(subdir)
+ 
+ uninstall:
+ 	$(RM) $(DESTDIR)$(insbuilddir)/$(subdir)/*
*** ./src/makefiles/Makefile.pgxs.orig	Mon May 24 15:32:24 2004
--- ./src/makefiles/Makefile.pgxs	Mon May 24 15:32:24 2004
***************
*** 0 ****
--- 1,40 ----
+ # PGXS: PostgreSQL extensions template makefile
+ #
+ # This file contains generic rules to build many kinds of simple
+ # contrib modules.  You only need to set a few variables and include
+ # this file, the rest will be done here.
+ #
+ #   MODULES -- list of shared objects to be build from source file with
+ #     same stem (do not include suffix in this list)
+ #   DATA -- random files to install into $PREFIX/share/contrib
+ #   DATA_built -- random files to install into $PREFIX/share/contrib,
+ #     which need to be built first
+ #   DOCS -- random files to install under $PREFIX/doc/contrib
+ #   SCRIPTS -- script files (not binaries) to install into $PREFIX/bin
+ #   SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
+ #     which need to be built first
+ #   REGRESS -- list of regression test cases (without suffix)
+ #
+ # or at most one of these two:
+ #
+ #   PROGRAM -- a binary program to build (list objects files in OBJS)
+ #   MODULE_big -- a shared object to build (list object files in OBJS)
+ #
+ # The following can also be set:
+ #
+ #   EXTRA_CLEAN -- extra files to remove in 'make clean'
+ #   PG_CPPFLAGS -- will be added to CPPFLAGS
+ #   PG_LIBS -- will be added to PROGRAM link line
+ #   SHLIB_LINK -- will be added to MODULE_big link line
+ #
+ # Better look at some of the existing uses for examples in contrib/
+ #
+ # isbn_issn type contribution:
+ #MODULES = isbn_issn
+ #DATA_built = isbn_issn.sql
+ #DOCS = README.isbn_issn
+ 
+ PGXS := $(shell pg_config --pgxs)
+ include $(PGXS)/pgxs.mk
+ 
+ # put here any specific rules.
*** ./src/makefiles/pgxs.mk.orig	Mon May 24 15:32:24 2004
--- ./src/makefiles/pgxs.mk	Mon May 24 15:32:24 2004
***************
*** 0 ****
--- 1,210 ----
+ # $PostgreSQL$ 
+ #
+ # PGXS: PostGreSQL eXtensionS initial directory
+ #
+ 
+ ifndef PGXS
+ $(error pgxs error: PGXS makefile macro must be set)
+ endif
+ 
+ # we assume that we are in ./src/makefiles, so top is:
+ top_builddir := $(PGXS)/../..
+ 
+ # other macros are needed? subdir?
+ 
+ # now we assume we're in the main tree.
+ include $(top_builddir)/src/Makefile.global
+ 
+ # issues:
+ # - what about includes? fixed with "ifdef PGXS" in Makefile.global
+ # - others?
+ 
+ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
+ 
+ ifdef MODULES
+ override CFLAGS += $(CFLAGS_SL)
+ SHLIB_LINK += $(BE_DLLLIBS)
+ endif
+ 
+ ifdef PG_CPPFLAGS
+ override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS)
+ endif
+ 
+ all: $(PROGRAM) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES))
+ 
+ ifdef MODULE_big
+ # shared library parameters
+ NAME = $(MODULE_big)
+ SO_MAJOR_VERSION= 0
+ SO_MINOR_VERSION= 0
+ rpath =
+ 
+ SHLIB_LINK += $(BE_DLLLIBS)
+ 
+ include $(top_srcdir)/src/Makefile.shlib
+ 
+ all: all-lib
+ endif # MODULE_big
+ 
+ 
+ install: all installdirs
+ ifneq (,$(DATA)$(DATA_built))
+ 	@for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \
+ 	  echo "$(INSTALL_DATA) $$file $(DESTDIR)$(datadir)/contrib"; \
+ 	  $(INSTALL_DATA) $$file $(DESTDIR)$(datadir)/contrib; \
+ 	done
+ endif # DATA
+ ifdef MODULES
+ 	@for file in $(addsuffix $(DLSUFFIX), $(MODULES)); do \
+ 	  echo "$(INSTALL_SHLIB) $$file $(DESTDIR)$(pkglibdir)"; \
+ 	  $(INSTALL_SHLIB) $$file $(DESTDIR)$(pkglibdir); \
+ 	done
+ endif # MODULES
+ ifdef DOCS
+ 	@for file in $(addprefix $(srcdir)/, $(DOCS)); do \
+ 	  echo "$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/contrib"; \
+ 	  $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/contrib; \
+ 	done
+ endif # DOCS
+ ifdef PROGRAM
+ 	$(INSTALL_PROGRAM) $(PROGRAM)$(X) $(DESTDIR)$(bindir)
+ endif # PROGRAM
+ ifdef MODULE_big
+ 	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(MODULE_big)$(DLSUFFIX)
+ endif # MODULE_big
+ ifdef SCRIPTS
+ 	@for file in $(addprefix $(srcdir)/, $(SCRIPTS)); do \
+ 	  echo "$(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir)"; \
+ 	  $(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir); \
+ 	done
+ endif # SCRIPTS
+ ifdef SCRIPTS_built
+ 	@for file in $(SCRIPTS_built); do \
+ 	  echo "$(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir)"; \
+ 	  $(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir); \
+ 	done
+ endif # SCRIPTS_built
+ 
+ 
+ installdirs:
+ ifneq (,$(DATA)$(DATA_built))
+ 	$(mkinstalldirs) $(DESTDIR)$(datadir)/contrib
+ endif
+ ifneq (,$(MODULES)$(MODULE_big))
+ 	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
+ endif
+ ifdef DOCS
+ 	$(mkinstalldirs) $(DESTDIR)$(docdir)/contrib
+ endif
+ ifneq (,$(PROGRAM)$(SCRIPTS)$(SCRIPTS_built))
+ 	$(mkinstalldirs) $(DESTDIR)$(bindir)
+ endif
+ 
+ 
+ uninstall:
+ ifneq (,$(DATA)$(DATA_built))
+ 	rm -f $(addprefix $(DESTDIR)$(datadir)/contrib/, $(notdir $(DATA) $(DATA_built)))
+ endif
+ ifdef MODULES
+ 	rm -f $(addprefix $(DESTDIR)$(pkglibdir)/, $(addsuffix $(DLSUFFIX), $(MODULES)))
+ endif
+ ifdef DOCS
+ 	rm -f $(addprefix $(DESTDIR)$(docdir)/contrib/, $(DOCS))
+ endif
+ ifdef PROGRAM
+ 	rm -f $(DESTDIR)$(bindir)/$(PROGRAM)$(X)
+ endif
+ ifdef MODULE_big
+ 	rm -f $(DESTDIR)$(pkglibdir)/$(MODULE_big)$(DLSUFFIX)
+ endif
+ ifdef SCRIPTS
+ 	rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS))
+ endif
+ ifdef SCRIPTS_built
+ 	rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS_built))
+ endif
+ 
+ 
+ clean:
+ ifdef MODULES
+ 	rm -f $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .o, $(MODULES))
+ endif
+ ifdef DATA_built
+ 	rm -f $(DATA_built)
+ endif
+ ifdef SCRIPTS_built
+ 	rm -f $(SCRIPTS_built)
+ endif
+ ifdef PROGRAM
+ 	rm -f $(PROGRAM)$(X)
+ endif
+ ifdef OBJS
+ 	rm -f $(OBJS)
+ endif
+ ifdef EXTRA_CLEAN
+ 	rm -f $(EXTRA_CLEAN)
+ endif
+ ifdef REGRESS
+ # things created by various check targets
+ 	rm -rf results tmp_check log
+ 	rm -f regression.diffs regression.out regress.out run_check.out
+ ifeq ($(PORTNAME), win)
+ 	rm -f regress.def
+ endif
+ endif # REGRESS
+ 
+ ifdef MODULE_big
+ clean: clean-lib
+ endif
+ 
+ distclean maintainer-clean: clean
+ 
+ 
+ ifdef REGRESS
+ 
+ # When doing a VPATH build, must copy over the test .sql and .out
+ # files so that the driver script can find them.  We have to use an
+ # absolute path for the targets, because otherwise make will try to
+ # locate the missing files using VPATH, and will find them in
+ # $(srcdir), but the point here is that we want to copy them from
+ # $(srcdir) to the build directory.
+ 
+ ifdef VPATH
+ abs_builddir := $(shell pwd)
+ test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) $(wildcard $(srcdir)/data/*.data)
+ test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src))
+ 
+ all: $(test_files_build)
+ $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
+ 	ln -s $< $@
+ endif # VPATH
+ 
+ .PHONY: submake
+ submake:
+ 	$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
+ 
+ # against installed postmaster
+ installcheck: submake
+ 	$(top_builddir)/src/test/regress/pg_regress $(REGRESS)
+ 
+ # in-tree test doesn't work yet (no way to install my shared library)
+ #check: all submake
+ #	$(top_builddir)/src/test/regress/pg_regress --temp-install \
+ #	  --top-builddir=$(top_builddir) $(REGRESS)
+ check:
+ 	@echo "'make check' is not supported."
+ 	@echo "Do 'make install', then 'make installcheck' instead."
+ endif # REGRESS
+ 
+ 
+ # STANDARD RULES
+ 
+ ifneq (,$(MODULES)$(MODULE_big))
+ %.sql: %.sql.in
+ 	sed 's,MODULE_PATHNAME,$$libdir/$*,g' $< >$@
+ endif
+ 
+ ifdef PROGRAM
+ $(PROGRAM): $(OBJS)
+ 	$(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LIBS) -o $@
+ endif
*** ./src/port/Makefile.orig	Mon May 24 11:26:32 2004
--- ./src/port/Makefile	Mon May 24 15:32:24 2004
***************
*** 40,42 ****
--- 40,52 ----
  
  clean distclean maintainer-clean:
  	rm -f libpgport.a $(LIBOBJS) pg_config_paths.h
+ 
+ install-config-files: installdirs
+ 	$(INSTALL_STLIB) libpgport.a $(DESTDIR)$(insbuilddir)/$(subdir)
+ 
+ installdirs:
+ 	$(mkinstalldirs) $(DESTDIR)$(insbuilddir)/$(subdir)
+ 
+ uninstall:
+ 	$(RM) $(DESTDIR)$(insbuilddir)/$(subdir)/libpgport.a
+ 
*** ./src/utils/Makefile.orig	Sat Nov 29 20:52:15 2003
--- ./src/utils/Makefile	Mon May 24 15:32:24 2004
***************
*** 16,18 ****
--- 16,28 ----
  
  clean distclean maintainer-clean:
  	rm -f dllinit.o
+ 
+ uninstall:
+ 	$(RM) $(DESTDIR)$(insbuilddir)/$(subdir)/dllinit.o
+ 
+ install-config-files: installdirs
+ 	-[ -f dllinit.o ] && \
+ 		$(INSTALL_DATA) dllinit.o $(DESTDIR)$(insbuilddir)/$(subdir)
+ 
+ installdirs:
+ 	$(mkinstalldirs) $(DESTDIR)$(insbuilddir)/$(subdir)