Please find enclose a submission to fix these problems.

The patch adds missing the "libpgport.a" file to the installation under
"install-all-headers". It is needed by some contribs. I install the
library in "pkglibdir", but I was wondering whether it should be "libdir"?
I was wondering also whether it would make sense to have a "libpgport.so"?

It fixes various macros which are used by contrib makefiles, especially
libpq_*dir and LDFLAGS when used under PGXS. It seems to me that they are
needed to

It adds the ability to test and use PGXS with contribs, with "make
USE_PGXS=1". Without the macro, this is exactly as before, there should be
no difference, esp. wrt the vpath feature that seemed broken by previous
submission. So it should not harm anybody, and it is useful at least to me.

It fixes some inconsistencies in various contrib makefiles
(useless override, ":=" instead of "=").

It works for me. it validates.

I'm available to fix any problem with this patch.

Have a nice day,

-- 
Fabien Coelho - [EMAIL PROTECTED]
*** ./contrib/btree_gist/Makefile.orig  Fri May 28 15:09:43 2004
--- ./contrib/btree_gist/Makefile       Tue Aug 17 11:54:08 2004
***************
*** 1,8 ****
  
- subdir = contrib/btree_gist
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULE_big  = btree_gist
  
  OBJS        = btree_gist.o btree_utils_num.o btree_utils_var.o btree_int2.o 
btree_int4.o btree_int8.o \
--- 1,4 ----
***************
*** 16,19 ****
--- 12,23 ----
  REGRESS     = init int2 int4 int8 float4 float8 cash oid timestamp timestamptz time 
timetz \
                date interval macaddr inet cidr text varchar char bytea bit varbit 
numeric
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/btree_gist
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/chkpass/Makefile.orig     Sat Nov 29 20:51:19 2003
--- ./contrib/chkpass/Makefile  Tue Aug 17 11:54:08 2004
***************
*** 1,13 ****
  # $PostgreSQL: pgsql-server/contrib/chkpass/Makefile,v 1.5 2003/11/29 19:51:19 pgsql 
Exp $
  
- subdir = contrib/chkpass
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULE_big = chkpass
  OBJS = chkpass.o
  SHLIB_LINK = $(filter -lcrypt, $(LIBS))
  DATA_built = chkpass.sql
  DOCS = README.chkpass
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,17 ----
  # $PostgreSQL: pgsql-server/contrib/chkpass/Makefile,v 1.5 2003/11/29 19:51:19 pgsql 
Exp $
  
  MODULE_big = chkpass
  OBJS = chkpass.o
  SHLIB_LINK = $(filter -lcrypt, $(LIBS))
  DATA_built = chkpass.sql
  DOCS = README.chkpass
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/chkpass
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/cube/Makefile.orig        Sat Nov 29 20:51:21 2003
--- ./contrib/cube/Makefile     Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/cube/Makefile,v 1.11 2003/11/29 19:51:21 pgsql 
Exp $
  
- subdir = contrib/cube
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULE_big = cube
  OBJS= cube.o cubeparse.o
  
--- 1,5 ----
***************
*** 11,16 ****
--- 7,25 ----
  DOCS = README.cube
  REGRESS = cube
  
+ EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
+ 
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/cube
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
+ endif
+ 
  
  # cubescan is compiled as part of cubeparse
  cubeparse.o: cubescan.c
***************
*** 32,39 ****
  else
        @$(missing) flex $< $@
  endif
- 
- EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
- 
- 
- include $(top_srcdir)/contrib/contrib-global.mk
--- 41,43 ----
*** ./contrib/dbase/Makefile.orig       Sat Nov 29 20:51:22 2003
--- ./contrib/dbase/Makefile    Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/dbase/Makefile,v 1.5 2003/11/29 19:51:22 pgsql 
Exp $
  
- subdir = contrib/dbase
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = dbf2pg
  OBJS  = dbf.o dbf2pg.o endian.o
  PG_CPPFLAGS = -I$(libpq_srcdir)
--- 1,5 ----
***************
*** 18,21 ****
--- 14,26 ----
  DOCS = README.dbf2pg
  MAN = dbf2pg.1                        # XXX not implemented
  
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/dbase
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/dblink/Makefile.orig      Sat Nov 29 20:51:34 2003
--- ./contrib/dblink/Makefile   Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/dblink/Makefile,v 1.8 2003/11/29 19:51:34 pgsql 
Exp $
  
- subdir = contrib/dblink
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULE_big = dblink
  PG_CPPFLAGS = -I$(libpq_srcdir)
  OBJS  = dblink.o
--- 1,5 ----
***************
*** 13,16 ****
--- 9,21 ----
  DOCS = README.dblink
  REGRESS = dblink
  
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/dblink
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/dbmirror/Makefile.orig    Sat Nov 29 20:51:34 2003
--- ./contrib/dbmirror/Makefile Tue Aug 17 11:54:08 2004
***************
*** 1,10 ****
  # $PostgreSQL: pgsql-server/contrib/dbmirror/Makefile,v 1.2 2003/11/29 19:51:34 
pgsql Exp $
  
- subdir = contrib/dbmirror
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = pending
  DOCS = README.dbmirror
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,14 ----
  # $PostgreSQL: pgsql-server/contrib/dbmirror/Makefile,v 1.2 2003/11/29 19:51:34 
pgsql Exp $
  
  MODULES = pending
  DOCS = README.dbmirror
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/dbmirror
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/dbsize/Makefile.orig      Sat Feb 23 00:05:35 2002
--- ./contrib/dbsize/Makefile   Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
- subdir = contrib/dbsize
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = dbsize
  DATA_built = dbsize.sql
  DOCS = README.dbsize
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,13 ----
  MODULES = dbsize
  DATA_built = dbsize.sql
  DOCS = README.dbsize
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/dbsize
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/earthdistance/Makefile.orig       Sat Nov 29 20:51:35 2003
--- ./contrib/earthdistance/Makefile    Tue Aug 17 14:07:29 2004
***************
*** 1,12 ****
  # $PostgreSQL: contrib/earthdistance/Makefile,v 1.13 2003/11/29 19:51:35 pgsql Exp $
  
- subdir = contrib/earthdistance
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = earthdistance
  DATA_built = earthdistance.sql
  DOCS = README.earthdistance
  REGRESS = earthdistance
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,16 ----
  # $PostgreSQL: contrib/earthdistance/Makefile,v 1.13 2003/11/29 19:51:35 pgsql Exp $
  
  MODULES = earthdistance
  DATA_built = earthdistance.sql
  DOCS = README.earthdistance
  REGRESS = earthdistance
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/earthdistance
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/findoidjoins/Makefile.orig        Sat Nov 29 20:51:35 2003
--- ./contrib/findoidjoins/Makefile     Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/findoidjoins/Makefile,v 1.15 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/findoidjoins
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = findoidjoins
  OBJS  = findoidjoins.o
  
--- 1,5 ----
***************
*** 13,16 ****
--- 9,20 ----
  SCRIPTS = make_oidjoins_check
  DOCS = README.findoidjoins
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/findoidjoins
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/fulltextindex/Makefile.orig       Sat Nov 29 20:51:35 2003
--- ./contrib/fulltextindex/Makefile    Tue Aug 17 11:54:08 2004
***************
*** 1,12 ****
  # $PostgreSQL: pgsql-server/contrib/fulltextindex/Makefile,v 1.12 2003/11/29 
19:51:35 pgsql Exp $
  
- subdir = contrib/fulltextindex
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = fti
  DATA_built = fti.sql
  DOCS = README.fti
  SCRIPTS = fti.pl
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,16 ----
  # $PostgreSQL: pgsql-server/contrib/fulltextindex/Makefile,v 1.12 2003/11/29 
19:51:35 pgsql Exp $
  
  MODULES = fti
  DATA_built = fti.sql
  DOCS = README.fti
  SCRIPTS = fti.pl
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/fulltextindex
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/fuzzystrmatch/Makefile.orig       Thu Jul  1 13:18:22 2004
--- ./contrib/fuzzystrmatch/Makefile    Tue Aug 17 11:54:08 2004
***************
*** 1,13 ****
  # $PostgreSQL: pgsql-server/contrib/fuzzystrmatch/Makefile,v 1.4 2004/07/01 03:25:48 
joe Exp $
  
- subdir = contrib/fuzzystrmatch
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULE_big = fuzzystrmatch
  SRCS += fuzzystrmatch.c dmetaphone.c
  OBJS = $(SRCS:.c=.o)
  DATA_built = fuzzystrmatch.sql
  DOCS = README.fuzzystrmatch README.soundex
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,17 ----
  # $PostgreSQL: pgsql-server/contrib/fuzzystrmatch/Makefile,v 1.4 2004/07/01 03:25:48 
joe Exp $
  
  MODULE_big = fuzzystrmatch
  SRCS += fuzzystrmatch.c dmetaphone.c
  OBJS = $(SRCS:.c=.o)
  DATA_built = fuzzystrmatch.sql
  DOCS = README.fuzzystrmatch README.soundex
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/fuzzystrmatch
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/intagg/Makefile.orig      Sat Nov 29 20:51:35 2003
--- ./contrib/intagg/Makefile   Tue Aug 17 11:54:08 2004
***************
*** 4,15 ****
  # by Mark L. Woodward
  # $PostgreSQL: pgsql-server/contrib/intagg/Makefile,v 1.4 2003/11/29 19:51:35 pgsql 
Exp $
  
- subdir = contrib/intagg
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = int_aggregate
  DATA_built = int_aggregate.sql
  DOCS = README.int_aggregate
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 4,19 ----
  # by Mark L. Woodward
  # $PostgreSQL: pgsql-server/contrib/intagg/Makefile,v 1.4 2003/11/29 19:51:35 pgsql 
Exp $
  
  MODULES = int_aggregate
  DATA_built = int_aggregate.sql
  DOCS = README.int_aggregate
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/intagg
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/intarray/Makefile.orig    Sat Nov 29 20:51:35 2003
--- ./contrib/intarray/Makefile Tue Aug 17 11:54:08 2004
***************
*** 1,13 ****
  # $PostgreSQL: pgsql-server/contrib/intarray/Makefile,v 1.10 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/intarray
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  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
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,17 ----
  # $PostgreSQL: pgsql-server/contrib/intarray/Makefile,v 1.10 2003/11/29 19:51:35 
pgsql Exp $
  
  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
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/intarray
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/isbn_issn/Makefile.orig   Sat Nov 29 20:51:35 2003
--- ./contrib/isbn_issn/Makefile        Tue Aug 17 11:54:08 2004
***************
*** 1,11 ****
  # $PostgreSQL: pgsql-server/contrib/isbn_issn/Makefile,v 1.12 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/isbn_issn
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = isbn_issn
  DATA_built = isbn_issn.sql
  DOCS = README.isbn_issn
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,15 ----
  # $PostgreSQL: pgsql-server/contrib/isbn_issn/Makefile,v 1.12 2003/11/29 19:51:35 
pgsql Exp $
  
  MODULES = isbn_issn
  DATA_built = isbn_issn.sql
  DOCS = README.isbn_issn
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/isbn_issn
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/lo/Makefile.orig  Sat Nov 29 20:51:35 2003
--- ./contrib/lo/Makefile       Tue Aug 17 11:54:08 2004
***************
*** 1,12 ****
  # $PostgreSQL: pgsql-server/contrib/lo/Makefile,v 1.12 2003/11/29 19:51:35 pgsql Exp 
$
  
- subdir = contrib/lo
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = lo
  DATA_built = lo.sql
  DATA = lo_drop.sql lo_test.sql
  DOCS = README.lo
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,16 ----
  # $PostgreSQL: pgsql-server/contrib/lo/Makefile,v 1.12 2003/11/29 19:51:35 pgsql Exp 
$
  
  MODULES = lo
  DATA_built = lo.sql
  DATA = lo_drop.sql lo_test.sql
  DOCS = README.lo
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/lo
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/ltree/Makefile.orig       Sat Nov  2 00:16:52 2002
--- ./contrib/ltree/Makefile    Tue Aug 17 11:54:08 2004
***************
*** 1,7 ****
- subdir = contrib/ltree
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PG_CPPFLAGS = -DLOWER_NODE
  MODULE_big = ltree
  OBJS =        ltree_io.o ltree_op.o lquery_op.o _ltree_op.o crc32.o \
--- 1,3 ----
***************
*** 10,13 ****
--- 6,17 ----
  DOCS = README.ltree
  REGRESS = ltree
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/ltree
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/mSQL-interface/Makefile.orig      Sat Nov 29 20:51:35 2003
--- ./contrib/mSQL-interface/Makefile   Tue Aug 17 11:54:08 2004
***************
*** 2,19 ****
  # $PostgreSQL: pgsql-server/contrib/mSQL-interface/Makefile,v 1.8 2003/11/29 
19:51:35 pgsql Exp $
  #
  
  subdir = contrib/mSQL-interface
  top_builddir = ../..
  include $(top_builddir)/src/Makefile.global
! 
! NAME  := mpgsql
! SO_MAJOR_VERSION := 0
! SO_MINOR_VERSION := 0
! OBJS  := mpgsql.o
! 
! override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
! 
! include $(top_srcdir)/src/Makefile.shlib
  
  all: all-lib
  
--- 2,23 ----
  # $PostgreSQL: pgsql-server/contrib/mSQL-interface/Makefile,v 1.8 2003/11/29 
19:51:35 pgsql Exp $
  #
  
+ NAME  = mpgsql
+ SO_MAJOR_VERSION = 0
+ SO_MINOR_VERSION = 0
+ OBJS  = mpgsql.o
+ 
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
  subdir = contrib/mSQL-interface
  top_builddir = ../..
  include $(top_builddir)/src/Makefile.global
! include $(top_srcdir)/contrib/contrib-global.mk
! endif
  
  all: all-lib
  
*** ./contrib/miscutil/Makefile.orig    Sat Nov 29 20:51:35 2003
--- ./contrib/miscutil/Makefile Tue Aug 17 11:54:08 2004
***************
*** 1,11 ****
  # $PostgreSQL: pgsql-server/contrib/miscutil/Makefile,v 1.17 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/miscutil
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = misc_utils
  DATA_built = misc_utils.sql
  DOCS = README.misc_utils
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,15 ----
  # $PostgreSQL: pgsql-server/contrib/miscutil/Makefile,v 1.17 2003/11/29 19:51:35 
pgsql Exp $
  
  MODULES = misc_utils
  DATA_built = misc_utils.sql
  DOCS = README.misc_utils
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/miscutil
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/noupdate/Makefile.orig    Sat Nov 29 20:51:35 2003
--- ./contrib/noupdate/Makefile Tue Aug 17 11:54:08 2004
***************
*** 1,11 ****
  # $PostgreSQL: pgsql-server/contrib/noupdate/Makefile,v 1.10 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/noupdate
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = noup
  DATA_built = noup.sql
  DOCS = README.noup
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,15 ----
  # $PostgreSQL: pgsql-server/contrib/noupdate/Makefile,v 1.10 2003/11/29 19:51:35 
pgsql Exp $
  
  MODULES = noup
  DATA_built = noup.sql
  DOCS = README.noup
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/noupdate
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/oid2name/Makefile.orig    Sat Nov 29 20:51:35 2003
--- ./contrib/oid2name/Makefile Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/oid2name/Makefile,v 1.5 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/oid2name
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = oid2name
  OBJS  = oid2name.o
  
--- 1,5 ----
***************
*** 12,15 ****
--- 8,19 ----
  
  DOCS = README.oid2name
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/oid2name
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/pg_autovacuum/Makefile.orig       Thu Mar 20 19:14:46 2003
--- ./contrib/pg_autovacuum/Makefile    Tue Aug 17 11:54:08 2004
***************
*** 1,8 ****
- 
- subdir = contrib/pg_autovacuum
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = pg_autovacuum
  OBJS  = pg_autovacuum.o
  
--- 1,3 ----
***************
*** 11,14 ****
--- 6,17 ----
  
  DOCS = README.pg_autovacuum
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/pg_autovacuum
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/pg_dumplo/Makefile.orig   Sat Nov 29 20:51:35 2003
--- ./contrib/pg_dumplo/Makefile        Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/pg_dumplo/Makefile,v 1.12 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/pg_dumplo
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = pg_dumplo
  OBJS  = main.o lo_export.o lo_import.o utils.o
  
--- 1,5 ----
***************
*** 12,15 ****
--- 8,19 ----
  
  DOCS = README.pg_dumplo
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/pg_dumplo
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/pg_logger/Makefile.orig   Sat Nov 29 20:51:35 2003
--- ./contrib/pg_logger/Makefile        Tue Aug 17 11:54:08 2004
***************
*** 1,12 ****
  # $PostgreSQL: pgsql-server/contrib/pg_logger/Makefile,v 1.3 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/pg_logger
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = pg_logger
  OBJS  = pg_logger.o
  
  DOCS = README.pg_logger
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,16 ----
  # $PostgreSQL: pgsql-server/contrib/pg_logger/Makefile,v 1.3 2003/11/29 19:51:35 
pgsql Exp $
  
  PROGRAM = pg_logger
  OBJS  = pg_logger.o
  
  DOCS = README.pg_logger
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/pg_logger
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/pg_trgm/Makefile.orig     Mon May 31 19:18:11 2004
--- ./contrib/pg_trgm/Makefile  Tue Aug 17 14:08:26 2004
***************
*** 1,9 ****
- subdir = contrib/pg_trgm
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
! 
! override CPPFLAGS := -I. $(CPPFLAGS)
  
  MODULE_big = pg_trgm
  OBJS = trgm_op.o trgm_gist.o 
--- 1,5 ----
  
! PG_CPPFLAGS = -I.
  
  MODULE_big = pg_trgm
  OBJS = trgm_op.o trgm_gist.o 
***************
*** 12,17 ****
--- 8,24 ----
  DOCS = README.pg_trgm
  REGRESS = pg_trgm
  
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/pg_trgm
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
+ 
+ 
  # DO NOT DELETE
  
*** ./contrib/pgbench/Makefile.orig     Sat Nov 29 20:51:35 2003
--- ./contrib/pgbench/Makefile  Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/pgbench/Makefile,v 1.11 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/pgbench
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = pgbench
  OBJS  = pgbench.o
  
--- 1,5 ----
***************
*** 12,15 ****
--- 8,19 ----
  
  DOCS = README.pgbench README.pgbench_jis
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/pgbench
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/pgcrypto/Makefile.orig    Sat Nov 29 20:51:35 2003
--- ./contrib/pgcrypto/Makefile Tue Aug 17 13:49:52 2004
***************
*** 2,11 ****
  # $PostgreSQL: pgsql-server/contrib/pgcrypto/Makefile,v 1.10 2003/11/29 19:51:35 
pgsql Exp $
  #
  
- subdir = contrib/pgcrypto
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  # either 'builtin', 'mhash', 'openssl'
  cryptolib = builtin
  
--- 2,7 ----
***************
*** 60,84 ****
  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 
  
  include $(top_srcdir)/contrib/contrib-global.mk
  
  rijndael.o: rijndael.tbl
  
  rijndael.tbl:
        $(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
        ./gen-rtab > rijndael.tbl
- 
--- 56,90 ----
  CRYPTO_CFLAGS += -DRAND_SILLY
  endif
  
  SRCS          += pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \
                        crypt-gensalt.c random.c
  
! MODULE_big    = pgcrypto
! 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 
  
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/pgcrypto
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
+ 
  
  rijndael.o: rijndael.tbl
  
  rijndael.tbl:
        $(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
        ./gen-rtab > rijndael.tbl
*** ./contrib/pgstattuple/Makefile.orig Sat Nov 29 23:39:29 2003
--- ./contrib/pgstattuple/Makefile      Tue Aug 17 13:52:47 2004
***************
*** 6,22 ****
  #
  #-------------------------------------------------------------------------
  
  subdir = contrib/pgstattuple
  top_builddir = ../..
  include $(top_builddir)/src/Makefile.global
- 
- 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    :=
- 
  include $(top_srcdir)/contrib/contrib-global.mk
--- 6,25 ----
  #
  #-------------------------------------------------------------------------
  
+ SRCS          = pgstattuple.c
+ 
+ MODULE_big    = pgstattuple
+ OBJS          = $(SRCS:.c=.o)
+ DOCS          = README.pgstattuple README.pgstattuple.euc_jp
+ DATA_built    = pgstattuple.sql
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
  subdir = contrib/pgstattuple
  top_builddir = ../..
  include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
+ 
*** ./contrib/rserv/Makefile.orig       Sat Nov  2 00:45:37 2002
--- ./contrib/rserv/Makefile    Tue Aug 17 13:53:51 2004
***************
*** 1,10 ****
  # Makefile for erServer demonstration implementation
  # (c) 2000 Vadim Mikheev, PostgreSQL Inc.
  
- subdir = contrib/rserv
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  NAME  = rserv
  MODULES       = rserv
  DATA  = RServ.pm
--- 1,6 ----
***************
*** 18,23 ****
--- 14,30 ----
  SCRIPTS_built += InitRservTest
  
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/rserv
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
+ endif
+ 
+ 
  $(SQLS): %.sql: %.sql.in
        sed 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' $< >$@
  
***************
*** 27,31 ****
            -e 's:@BINDIR@:$(bindir):g' \
            -e 's:@LIBDIR@:$(datadir)/contrib:g' $< >$@
        chmod a+x $@
- 
- include $(top_srcdir)/contrib/contrib-global.mk
--- 34,36 ----
*** ./contrib/rtree_gist/Makefile.orig  Sat Nov 29 20:51:35 2003
--- ./contrib/rtree_gist/Makefile       Tue Aug 17 13:55:05 2004
***************
*** 1,12 ****
  # $PostgreSQL: pgsql-server/contrib/rtree_gist/Makefile,v 1.4 2003/11/29 19:51:35 
pgsql Exp $
  
- subdir = contrib/rtree_gist
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = rtree_gist
  DATA_built = rtree_gist.sql
  DOCS = README.rtree_gist
  REGRESS = rtree_gist
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,16 ----
  # $PostgreSQL: pgsql-server/contrib/rtree_gist/Makefile,v 1.4 2003/11/29 19:51:35 
pgsql Exp $
  
  MODULES = rtree_gist
  DATA_built = rtree_gist.sql
  DOCS = README.rtree_gist
  REGRESS = rtree_gist
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/rtree_gist
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/seg/Makefile.orig Sat Nov 29 20:51:35 2003
--- ./contrib/seg/Makefile      Tue Aug 17 13:55:56 2004
***************
*** 1,15 ****
  # $PostgreSQL: pgsql-server/contrib/seg/Makefile,v 1.11 2003/11/29 19:51:35 pgsql 
Exp $
  
- subdir = contrib/seg
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULE_big = seg
  OBJS = seg.o segparse.o
  DATA_built = seg.sql
  DOCS = README.seg
  REGRESS = seg
  
  
  # segscan is compiled as part of segparse
  segparse.o: segscan.c
--- 1,22 ----
  # $PostgreSQL: pgsql-server/contrib/seg/Makefile,v 1.11 2003/11/29 19:51:35 pgsql 
Exp $
  
  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
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/seg
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
+ endif
  
  # segscan is compiled as part of segparse
  segparse.o: segscan.c
***************
*** 31,38 ****
  else
        @$(missing) flex $< $@
  endif
- 
- EXTRA_CLEAN = segparse.c segparse.h segscan.c y.tab.c y.tab.h
- 
- 
- include $(top_srcdir)/contrib/contrib-global.mk
--- 38,40 ----
*** ./contrib/spi/Makefile.orig Sat Nov 29 20:51:35 2003
--- ./contrib/spi/Makefile      Tue Aug 17 11:54:08 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/spi/Makefile,v 1.23 2003/11/29 19:51:35 pgsql 
Exp $
  
- subdir = contrib/spi
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = autoinc insert_username moddatetime refint timetravel
  DATA_built = $(addsuffix .sql, $(MODULES))
  DOCS  = README.spi $(addsuffix .example, $(MODULES))
--- 1,5 ----
***************
*** 12,15 ****
--- 8,19 ----
  # comment out if you want a quieter refint package for other uses
  PG_CPPFLAGS = -DREFINT_VERBOSE
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/spi
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/string/Makefile.orig      Sat Nov 29 20:51:36 2003
--- ./contrib/string/Makefile   Tue Aug 17 13:57:56 2004
***************
*** 1,11 ****
  # $PostgreSQL: pgsql-server/contrib/string/Makefile,v 1.17 2003/11/29 19:51:36 pgsql 
Exp $
  
- subdir = contrib/string
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = string_io
  DATA_built = string_io.sql
  DOCS = README.string_io
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,15 ----
  # $PostgreSQL: pgsql-server/contrib/string/Makefile,v 1.17 2003/11/29 19:51:36 pgsql 
Exp $
  
  MODULES = string_io
  DATA_built = string_io.sql
  DOCS = README.string_io
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/string
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/tablefunc/Makefile.orig   Thu Sep 12 02:14:40 2002
--- ./contrib/tablefunc/Makefile        Tue Aug 17 13:59:29 2004
***************
*** 1,10 ****
- subdir = contrib/tablefunc
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = tablefunc
  DATA_built = tablefunc.sql
  DOCS = README.tablefunc
  REGRESS = tablefunc
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,14 ----
  MODULES = tablefunc
  DATA_built = tablefunc.sql
  DOCS = README.tablefunc
  REGRESS = tablefunc
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/tablefunc
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/tips/Makefile.orig        Sat Nov 29 20:51:36 2003
--- ./contrib/tips/Makefile     Tue Aug 17 14:00:45 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/tips/Makefile,v 1.6 2003/11/29 19:51:36 pgsql 
Exp $
  
  subdir = contrib/tips
  top_builddir = ../..
  include $(top_builddir)/src/Makefile.global
- 
- DOCS = README.apachelog
- 
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,13 ----
  # $PostgreSQL: pgsql-server/contrib/tips/Makefile,v 1.6 2003/11/29 19:51:36 pgsql 
Exp $
  
+ DOCS = README.apachelog
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
  subdir = contrib/tips
  top_builddir = ../..
  include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/tsearch/Makefile.orig     Sat Nov 29 20:51:36 2003
--- ./contrib/tsearch/Makefile  Tue Aug 17 14:01:48 2004
***************
*** 1,10 ****
  # $PostgreSQL: pgsql-server/contrib/tsearch/Makefile,v 1.4 2003/11/29 19:51:36 pgsql 
Exp $
  
! subdir = contrib/tsearch
! top_builddir = ../..
! include $(top_builddir)/src/Makefile.global
! 
! override CPPFLAGS := -I. $(CPPFLAGS)
  
  MODULE_big = tsearch
  OBJS = crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o
--- 1,6 ----
  # $PostgreSQL: pgsql-server/contrib/tsearch/Makefile,v 1.4 2003/11/29 19:51:36 pgsql 
Exp $
  
! PG_CPPFLAGS = -I.
  
  MODULE_big = tsearch
  OBJS = crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o
***************
*** 13,18 ****
--- 9,27 ----
  DOCS = README.tsearch
  REGRESS = tsearch
  
+ EXTRA_CLEAN = parser.c
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/tsearch
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
+ endif
+ 
+ 
  # parser is compiled as part of query
  query.o: parser.c
  
***************
*** 23,29 ****
        @$(missing) flex $< $@
  endif
  
- EXTRA_CLEAN = parser.c
- 
- include $(top_srcdir)/contrib/contrib-global.mk
  # DO NOT DELETE
--- 32,35 ----
*** ./contrib/tsearch2/Makefile.orig    Sat Nov 29 20:51:36 2003
--- ./contrib/tsearch2/Makefile Tue Aug 17 14:03:43 2004
***************
*** 1,10 ****
  # $PostgreSQL: pgsql-server/contrib/tsearch2/Makefile,v 1.6 2003/11/29 19:51:36 
pgsql Exp $
  
- subdir = contrib/tsearch2
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
- 
  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 \
--- 1,5 ----
***************
*** 15,26 ****
  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
  
--- 10,16 ----
  SUBDIRS     := snowball ispell wordparser
  SUBDIROBJS  := $(SUBDIRS:%=%/SUBSYS.o)
  
! OBJS  += $(SUBDIROBJS)
  
  PG_CPPFLAGS = -I$(srcdir)/snowball -I$(srcdir)/ispell -I$(srcdir)/wordparser
  
***************
*** 31,36 ****
--- 21,43 ----
  
  SHLIB_LINK := -lm
  
+ 
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/tsearch2
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
+ endif
+ 
+ 
+ $(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
+ 
+ $(SUBDIRS:%=%-recursive):
+       $(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
+ 
  tsearch2.sql: tsearch.sql.in
        sed -e 's,MODULE_PATHNAME,$$libdir/$(MODULE_big),g' \
            -e 's,DATA_PATH,$(datadir)/contrib,g' $< >$@
***************
*** 43,47 ****
  
  subclean:
        for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean || exit; done
-  
- include $(top_srcdir)/contrib/contrib-global.mk
--- 50,52 ----
*** ./contrib/userlock/Makefile.orig    Sat Nov 29 20:51:36 2003
--- ./contrib/userlock/Makefile Tue Aug 17 14:05:10 2004
***************
*** 1,11 ****
  # $PostgreSQL: pgsql-server/contrib/userlock/Makefile,v 1.17 2003/11/29 19:51:36 
pgsql Exp $
  
- subdir = contrib/userlock
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULES = user_locks
  DATA_built = user_locks.sql
  DOCS = README.user_locks
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,15 ----
  # $PostgreSQL: pgsql-server/contrib/userlock/Makefile,v 1.17 2003/11/29 19:51:36 
pgsql Exp $
  
  MODULES = user_locks
  DATA_built = user_locks.sql
  DOCS = README.user_locks
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/userlock
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/vacuumlo/Makefile.orig    Sat Nov 29 20:51:36 2003
--- ./contrib/vacuumlo/Makefile Tue Aug 17 14:05:44 2004
***************
*** 1,9 ****
  # $PostgreSQL: pgsql-server/contrib/vacuumlo/Makefile,v 1.12 2003/11/29 19:51:36 
pgsql Exp $
  
- subdir = contrib/vacuumlo
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  PROGRAM = vacuumlo
  OBJS  = vacuumlo.o
  
--- 1,5 ----
***************
*** 12,15 ****
--- 8,19 ----
  
  DOCS = README.vacuumlo
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/vacuumlo
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/xml/Makefile.orig Mon Mar 15 10:22:03 2004
--- ./contrib/xml/Makefile      Tue Aug 17 14:06:33 2004
***************
*** 1,13 ****
  # $Header: /home/coelho/WORK/COURS/sgbd/DEV/RCS/install_build_2.patch,v 1.3 
2004/08/17 12:11:46 coelho Exp $
  
- subdir = contrib/xml
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  MODULE_big = pgxml_dom
  OBJS = pgxml_dom.o
  SHLIB_LINK = -lxml2
  DATA_built = pgxml_dom.sql
  DOCS = README.xml
  
  include $(top_srcdir)/contrib/contrib-global.mk
--- 1,17 ----
  # $Header: /home/coelho/WORK/COURS/sgbd/DEV/RCS/install_build_2.patch,v 1.3 
2004/08/17 12:11:46 coelho Exp $
  
  MODULE_big = pgxml_dom
  OBJS = pgxml_dom.o
  SHLIB_LINK = -lxml2
  DATA_built = pgxml_dom.sql
  DOCS = README.xml
  
+ ifdef USE_PGXS
+ PGXS = $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ subdir = contrib/xml
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
  include $(top_srcdir)/contrib/contrib-global.mk
+ endif
*** ./contrib/xml2/Makefile.orig        Mon Mar 15 10:22:03 2004
--- ./contrib/xml2/Makefile     Tue Aug 17 14:07:01 2004
***************
*** 1,7 ****
  # This makefile will build the new XML and XSLT routines.
- subdir = contrib/xml2
- top_builddir = ../../
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big = pgxml
  
--- 1,4 ----
***************
*** 14,18 ****
  DATA_built = pgxml.sql
  DOCS = README.xml2
  
! include $(top_builddir)contrib/contrib-global.mk
  
--- 11,24 ----
  DATA_built = pgxml.sql
  DOCS = README.xml2
  
! 
! ifdef USE_PGXS
! PGXS = $(shell pg_config --pgxs)
! include $(PGXS)
! else
! subdir = contrib/xml2
! top_builddir = ../..
! include $(top_builddir)/src/Makefile.global
! include $(top_srcdir)/contrib/contrib-global.mk
! endif
  
*** ./src/Makefile.global.in.orig       Mon Aug 16 10:18:33 2004
--- ./src/Makefile.global.in    Tue Aug 17 14:11:16 2004
***************
*** 291,298 ****
--- 291,305 ----
  #
  # Some variables needed to find some client interfaces
  
+ ifdef PGXS
+ # some contribs assumes headers and libs are in the source tree...
+ libpq_srcdir = $(includedir)
+ libpq_builddir = $(libdir)
+ else
  libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
  libpq_builddir = $(top_builddir)/src/interfaces/libpq
+ endif
+ 
  libpq = -L$(libpq_builddir) -lpq
  
  submake-libpq:
***************
*** 351,358 ****
--- 358,370 ----
  
  ifneq (,$(LIBOBJS))
  LIBS := -lpgport $(LIBS)
+ ifdef PGXS
+ # where libpgport.a is installed
+ LDFLAGS := -L$(pkglibdir) $(LDFLAGS)
+ else
  LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS)
  endif
+ endif
  
  # to make ws2_32.lib the last library
  ifeq ($(PORTNAME),win32)
*** ./src/Makefile.orig Tue Aug 10 08:29:03 2004
--- ./src/Makefile      Tue Aug 17 11:54:09 2004
***************
*** 35,40 ****
--- 35,41 ----
  
  install-all-headers:
        $(MAKE) -C include $@
+       $(MAKE) -C port $@
  
  installdirs: installdirs-local
  
*** ./src/port/Makefile.orig    Tue Aug 10 08:29:13 2004
--- ./src/port/Makefile Tue Aug 17 13:44:28 2004
***************
*** 20,25 ****
--- 20,32 ----
  
  all: libpgport.a
  
+ # libpgport is needed by some contrib
+ install-all-headers: 
+       $(INSTALL_STLIB) libpgport.a $(DESTDIR)$(pkglibdir)
+ 
+ uninstall:
+       $(RM) $(DESTDIR)$(pkglibdir)/libpgport.a
+ 
  libpgport.a: $(LIBOBJS)
        $(AR) $(AROPT) $@ $^
  
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to