Dear patchers,

after Peter's massaging on pgxs, I think the infrastructure deserves
some more massaging because:

(a) some files are missing (namely libpgport.? needed by pgbench for
    instance, and I guess possibly by others).

(b) I think it is a key feature that one should be able to compile
    contrib with the already installed postgresql, without having
    to reconfigure.

so I submit this new patch. I've tried to preserve Peter modifications
to my initial submissions, plus:

(1) add libpgport installation under "install-all-headers" target

(2) all contrib Makefiles can ALSO use of the dynamic pgxs stuff
    => no direct inclusion of Makefile.global (which is generated by configure)
    => USE_PGXS macro enables that ("make USE_PGXS=1 install"), otherwise
       it is just as before the patch, the static "configured"
       infrastructured is used.

If there are still issues, which is perfectly possible, I'm really willing
to fix them while preserving the ability to compile postgresql contribs
with an already installed postgresql.

Basically it works for me.

Thanks in advance,

-- 
Fabien Coelho - [EMAIL PROTECTED]
*** ./contrib/btree_gist/Makefile.orig  Wed Aug 11 13:38:31 2004
--- ./contrib/btree_gist/Makefile       Wed Aug 11 13:41:31 2004
***************
*** 1,7 ****
  
  subdir = contrib/btree_gist
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big  = btree_gist
  
--- 1,6 ----
***************
*** 16,19 ****
  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
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 15,18 ----
  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
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/chkpass/Makefile.orig     Sat Nov 29 20:51:19 2003
--- ./contrib/chkpass/Makefile  Wed Aug 11 13:37:23 2004
***************
*** 2,8 ****
  
  subdir = contrib/chkpass
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big = chkpass
  OBJS = chkpass.o
--- 2,7 ----
***************
*** 10,13 ****
  DATA_built = chkpass.sql
  DOCS = README.chkpass
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 9,12 ----
  DATA_built = chkpass.sql
  DOCS = README.chkpass
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/contrib-global.mk.orig    Tue Aug 10 08:29:01 2004
--- ./contrib/contrib-global.mk Wed Aug 11 14:54:28 2004
***************
*** 1,4 ****
  # $PostgreSQL: pgsql-server/contrib/contrib-global.mk,v 1.8 2004/07/30 12:26:39 
petere Exp $
  
  NO_PGXS = 1
! include $(top_srcdir)/src/makefiles/pgxs.mk
--- 1,11 ----
  # $PostgreSQL: pgsql-server/contrib/contrib-global.mk,v 1.8 2004/07/30 12:26:39 
petere Exp $
  
+ ifdef USE_PGXS
+ # use PGXS dynamic infrastructure to compile with an installed postgresql
+ PGXS  := $(shell pg_config --pgxs)
+ include $(PGXS)
+ else
+ # simple local compilation for locally configured postgresql
  NO_PGXS = 1
! include $(top_builddir)/src/makefiles/pgxs.mk
! endif
*** ./contrib/cube/Makefile.orig        Wed Aug 11 13:38:31 2004
--- ./contrib/cube/Makefile     Wed Aug 11 13:42:19 2004
***************
*** 2,8 ****
  
  subdir = contrib/cube
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big = cube
  OBJS= cube.o cubeparse.o
--- 2,7 ----
***************
*** 11,16 ****
--- 10,18 ----
  DOCS = README.cube
  REGRESS = cube
  
+ EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
+ 
+ include $(top_builddir)/contrib/contrib-global.mk
  
  # 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
--- 34,36 ----
*** ./contrib/dbase/Makefile.orig       Wed Aug 11 13:38:31 2004
--- ./contrib/dbase/Makefile    Wed Aug 11 13:43:22 2004
***************
*** 2,8 ****
  
  subdir = contrib/dbase
  top_builddir = ../..
! include $(top_builddir)/src/Makefile.global
  
  PROGRAM = dbf2pg
  OBJS  = dbf.o dbf2pg.o endian.o
--- 2,8 ----
  
  subdir = contrib/dbase
  top_builddir = ../..
! #include $(top_builddir)/src/Makefile.global
  
  PROGRAM = dbf2pg
  OBJS  = dbf.o dbf2pg.o endian.o
***************
*** 18,21 ****
  DOCS = README.dbf2pg
  MAN = dbf2pg.1                        # XXX not implemented
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 18,21 ----
  DOCS = README.dbf2pg
  MAN = dbf2pg.1                        # XXX not implemented
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/dblink/Makefile.orig      Wed Aug 11 13:38:31 2004
--- ./contrib/dblink/Makefile   Wed Aug 11 13:45:35 2004
***************
*** 2,8 ****
  
  subdir = contrib/dblink
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big = dblink
  PG_CPPFLAGS = -I$(libpq_srcdir)
--- 2,7 ----
***************
*** 13,16 ****
  DOCS = README.dblink
  REGRESS = dblink
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 12,15 ----
  DOCS = README.dblink
  REGRESS = dblink
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/dbmirror/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/dbmirror/Makefile Wed Aug 11 13:46:29 2004
***************
*** 2,10 ****
  
  subdir = contrib/dbmirror
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULES = pending
  DOCS = README.dbmirror
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 2,9 ----
  
  subdir = contrib/dbmirror
  top_builddir = ../..
  
  MODULES = pending
  DOCS = README.dbmirror
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/dbsize/Makefile.orig      Wed Aug 11 13:38:31 2004
--- ./contrib/dbsize/Makefile   Wed Aug 11 13:46:42 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,8 ----
  subdir = contrib/dbsize
  top_builddir = ../..
  
  MODULES = dbsize
  DATA_built = dbsize.sql
  DOCS = README.dbsize
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/earthdistance/Makefile.orig       Wed Aug 11 13:38:31 2004
--- ./contrib/earthdistance/Makefile    Wed Aug 11 13:46:59 2004
***************
*** 2,12 ****
  
  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
--- 2,11 ----
  
  subdir = contrib/earthdistance
  top_builddir = ../..
  
  MODULES = earthdistance
  DATA_built = earthdistance.sql
  DOCS = README.earthdistance
  REGRESS = earthdistance
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/findoidjoins/Makefile.orig        Wed Aug 11 13:38:31 2004
--- ./contrib/findoidjoins/Makefile     Wed Aug 11 13:47:36 2004
***************
*** 2,8 ****
  
  subdir = contrib/findoidjoins
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  PROGRAM = findoidjoins
  OBJS  = findoidjoins.o
--- 2,7 ----
***************
*** 13,16 ****
  SCRIPTS = make_oidjoins_check
  DOCS = README.findoidjoins
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 12,15 ----
  SCRIPTS = make_oidjoins_check
  DOCS = README.findoidjoins
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/fulltextindex/Makefile.orig       Wed Aug 11 13:38:31 2004
--- ./contrib/fulltextindex/Makefile    Wed Aug 11 13:47:50 2004
***************
*** 2,12 ****
  
  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
--- 2,11 ----
  
  subdir = contrib/fulltextindex
  top_builddir = ../..
  
  MODULES = fti
  DATA_built = fti.sql
  DOCS = README.fti
  SCRIPTS = fti.pl
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/fuzzystrmatch/Makefile.orig       Wed Aug 11 13:38:31 2004
--- ./contrib/fuzzystrmatch/Makefile    Wed Aug 11 13:48:07 2004
***************
*** 2,8 ****
  
  subdir = contrib/fuzzystrmatch
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big = fuzzystrmatch
  SRCS += fuzzystrmatch.c dmetaphone.c
--- 2,7 ----
***************
*** 10,13 ****
  DATA_built = fuzzystrmatch.sql
  DOCS = README.fuzzystrmatch README.soundex
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 9,12 ----
  DATA_built = fuzzystrmatch.sql
  DOCS = README.fuzzystrmatch README.soundex
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/intagg/Makefile.orig      Wed Aug 11 13:38:31 2004
--- ./contrib/intagg/Makefile   Wed Aug 11 13:48:35 2004
***************
*** 6,15 ****
  
  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
--- 6,14 ----
  
  subdir = contrib/intagg
  top_builddir = ../..
  
  MODULES = int_aggregate
  DATA_built = int_aggregate.sql
  DOCS = README.int_aggregate
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/intarray/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/intarray/Makefile Wed Aug 11 13:48:55 2004
***************
*** 2,8 ****
  
  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 
--- 2,7 ----
***************
*** 10,13 ****
  DOCS = README.intarray
  REGRESS = _int
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 9,12 ----
  DOCS = README.intarray
  REGRESS = _int
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/isbn_issn/Makefile.orig   Wed Aug 11 13:38:31 2004
--- ./contrib/isbn_issn/Makefile        Wed Aug 11 13:49:18 2004
***************
*** 2,11 ****
  
  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
--- 2,10 ----
  
  subdir = contrib/isbn_issn
  top_builddir = ../..
  
  MODULES = isbn_issn
  DATA_built = isbn_issn.sql
  DOCS = README.isbn_issn
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/lo/Makefile.orig  Wed Aug 11 13:38:31 2004
--- ./contrib/lo/Makefile       Wed Aug 11 13:49:34 2004
***************
*** 2,12 ****
  
  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
--- 2,11 ----
  
  subdir = contrib/lo
  top_builddir = ../..
  
  MODULES = lo
  DATA_built = lo.sql
  DATA = lo_drop.sql lo_test.sql
  DOCS = README.lo
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/ltree/Makefile.orig       Wed Aug 11 13:38:31 2004
--- ./contrib/ltree/Makefile    Wed Aug 11 13:49:53 2004
***************
*** 1,6 ****
  subdir = contrib/ltree
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  PG_CPPFLAGS = -DLOWER_NODE
  MODULE_big = ltree
--- 1,5 ----
***************
*** 10,13 ****
  DOCS = README.ltree
  REGRESS = ltree
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 9,12 ----
  DOCS = README.ltree
  REGRESS = ltree
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/mSQL-interface/Makefile.orig      Wed Aug 11 13:38:31 2004
--- ./contrib/mSQL-interface/Makefile   Wed Aug 11 13:50:50 2004
***************
*** 4,10 ****
  
  subdir = contrib/mSQL-interface
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  NAME  := mpgsql
  SO_MAJOR_VERSION := 0
--- 4,9 ----
***************
*** 13,19 ****
  
  override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
  
! include $(top_srcdir)/src/Makefile.shlib
  
  all: all-lib
  
--- 12,18 ----
  
  override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
  
! include $(top_builddir)/contrib/contrib-global.mk
  
  all: all-lib
  
*** ./contrib/miscutil/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/miscutil/Makefile Wed Aug 11 13:51:34 2004
***************
*** 2,11 ****
  
  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
--- 2,10 ----
  
  subdir = contrib/miscutil
  top_builddir = ../..
  
  MODULES = misc_utils
  DATA_built = misc_utils.sql
  DOCS = README.misc_utils
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/noupdate/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/noupdate/Makefile Wed Aug 11 13:51:54 2004
***************
*** 2,11 ****
  
  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
--- 2,10 ----
  
  subdir = contrib/noupdate
  top_builddir = ../..
  
  MODULES = noup
  DATA_built = noup.sql
  DOCS = README.noup
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/oid2name/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/oid2name/Makefile Wed Aug 11 13:52:34 2004
***************
*** 2,8 ****
  
  subdir = contrib/oid2name
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  PROGRAM = oid2name
  OBJS  = oid2name.o
--- 2,7 ----
***************
*** 12,15 ****
  
  DOCS = README.oid2name
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 11,14 ----
  
  DOCS = README.oid2name
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/pg_autovacuum/Makefile.orig       Wed Aug 11 13:38:31 2004
--- ./contrib/pg_autovacuum/Makefile    Wed Aug 11 13:52:53 2004
***************
*** 1,7 ****
  
  subdir = contrib/pg_autovacuum
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  PROGRAM = pg_autovacuum
  OBJS  = pg_autovacuum.o
--- 1,6 ----
***************
*** 11,14 ****
  
  DOCS = README.pg_autovacuum
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 10,13 ----
  
  DOCS = README.pg_autovacuum
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/pg_dumplo/Makefile.orig   Wed Aug 11 13:38:31 2004
--- ./contrib/pg_dumplo/Makefile        Wed Aug 11 13:53:07 2004
***************
*** 2,8 ****
  
  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
--- 2,7 ----
***************
*** 12,15 ****
  
  DOCS = README.pg_dumplo
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 11,14 ----
  
  DOCS = README.pg_dumplo
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/pg_logger/Makefile.orig   Wed Aug 11 13:38:31 2004
--- ./contrib/pg_logger/Makefile        Wed Aug 11 13:53:17 2004
***************
*** 2,12 ****
  
  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
--- 2,11 ----
  
  subdir = contrib/pg_logger
  top_builddir = ../..
  
  PROGRAM = pg_logger
  OBJS  = pg_logger.o
  
  DOCS = README.pg_logger
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/pg_trgm/Makefile.orig     Wed Aug 11 13:38:31 2004
--- ./contrib/pg_trgm/Makefile  Wed Aug 11 13:53:31 2004
***************
*** 1,7 ****
  subdir = contrib/pg_trgm
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
- 
  
  override CPPFLAGS := -I. $(CPPFLAGS)
  
--- 1,5 ----
***************
*** 12,17 ****
  DOCS = README.pg_trgm
  REGRESS = pg_trgm
  
! include $(top_srcdir)/contrib/contrib-global.mk
  # DO NOT DELETE
  
--- 10,15 ----
  DOCS = README.pg_trgm
  REGRESS = pg_trgm
  
! include $(top_builddir)/contrib/contrib-global.mk
  # DO NOT DELETE
  
*** ./contrib/pgbench/Makefile.orig     Wed Aug 11 13:38:31 2004
--- ./contrib/pgbench/Makefile  Wed Aug 11 15:16:50 2004
***************
*** 2,8 ****
  
  subdir = contrib/pgbench
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  PROGRAM = pgbench
  OBJS  = pgbench.o
--- 2,7 ----
***************
*** 12,15 ****
  
  DOCS = README.pgbench README.pgbench_jis
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 11,17 ----
  
  DOCS = README.pgbench README.pgbench_jis
  
! include $(top_builddir)/contrib/contrib-global.mk
! 
! echo:
!       echo $(libpq_srcdir)
*** ./contrib/pgcrypto/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/pgcrypto/Makefile Wed Aug 11 13:54:30 2004
***************
*** 4,10 ****
  
  subdir = contrib/pgcrypto
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  # either 'builtin', 'mhash', 'openssl'
  cryptolib = builtin
--- 4,9 ----
***************
*** 74,84 ****
  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
- 
--- 73,82 ----
  REGRESS := init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
                crypt-des crypt-md5 crypt-blowfish crypt-xdes 
  
! include $(top_builddir)/contrib/contrib-global.mk
  
  rijndael.o: rijndael.tbl
  
  rijndael.tbl:
        $(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
        ./gen-rtab > rijndael.tbl
*** ./contrib/pgstattuple/Makefile.orig Wed Aug 11 13:38:31 2004
--- ./contrib/pgstattuple/Makefile      Wed Aug 11 13:54:52 2004
***************
*** 8,14 ****
  
  subdir = contrib/pgstattuple
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big    := pgstattuple
  SRCS          += pgstattuple.c
--- 8,13 ----
***************
*** 19,22 ****
  PG_CPPFLAGS   :=
  SHLIB_LINK    :=
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 18,21 ----
  PG_CPPFLAGS   :=
  SHLIB_LINK    :=
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/rserv/Makefile.orig       Wed Aug 11 13:38:31 2004
--- ./contrib/rserv/Makefile    Wed Aug 11 13:55:21 2004
***************
*** 3,9 ****
  
  subdir = contrib/rserv
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  NAME  = rserv
  MODULES       = rserv
--- 3,8 ----
***************
*** 17,22 ****
--- 16,22 ----
  SCRIPTS_built += PrepareSnapshot ApplySnapshot
  SCRIPTS_built += InitRservTest
  
+ include $(top_builddir)/contrib/contrib-global.mk
  
  $(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
--- 27,29 ----
*** ./contrib/rtree_gist/Makefile.orig  Wed Aug 11 13:38:31 2004
--- ./contrib/rtree_gist/Makefile       Wed Aug 11 13:55:42 2004
***************
*** 2,12 ****
  
  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
--- 2,11 ----
  
  subdir = contrib/rtree_gist
  top_builddir = ../..
  
  MODULES = rtree_gist
  DATA_built = rtree_gist.sql
  DOCS = README.rtree_gist
  REGRESS = rtree_gist
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/seg/Makefile.orig Wed Aug 11 13:38:31 2004
--- ./contrib/seg/Makefile      Wed Aug 11 13:56:09 2004
***************
*** 2,8 ****
  
  subdir = contrib/seg
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big = seg
  OBJS = seg.o segparse.o
--- 2,7 ----
***************
*** 10,15 ****
--- 9,17 ----
  DOCS = README.seg
  REGRESS = seg
  
+ EXTRA_CLEAN = segparse.c segparse.h segscan.c y.tab.c y.tab.h
+ 
+ include $(top_builddir)/contrib/contrib-global.mk
  
  # 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
--- 33,35 ----
*** ./contrib/spi/Makefile.orig Wed Aug 11 13:38:31 2004
--- ./contrib/spi/Makefile      Wed Aug 11 13:56:29 2004
***************
*** 2,8 ****
  
  subdir = contrib/spi
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULES = autoinc insert_username moddatetime refint timetravel
  DATA_built = $(addsuffix .sql, $(MODULES))
--- 2,7 ----
***************
*** 12,15 ****
  # comment out if you want a quieter refint package for other uses
  PG_CPPFLAGS = -DREFINT_VERBOSE
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 11,14 ----
  # comment out if you want a quieter refint package for other uses
  PG_CPPFLAGS = -DREFINT_VERBOSE
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/string/Makefile.orig      Wed Aug 11 13:38:31 2004
--- ./contrib/string/Makefile   Wed Aug 11 13:56:47 2004
***************
*** 2,11 ****
  
  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
--- 2,10 ----
  
  subdir = contrib/string
  top_builddir = ../..
  
  MODULES = string_io
  DATA_built = string_io.sql
  DOCS = README.string_io
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/tablefunc/Makefile.orig   Wed Aug 11 13:38:31 2004
--- ./contrib/tablefunc/Makefile        Wed Aug 11 13:56:57 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,9 ----
  subdir = contrib/tablefunc
  top_builddir = ../..
  
  MODULES = tablefunc
  DATA_built = tablefunc.sql
  DOCS = README.tablefunc
  REGRESS = tablefunc
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/tips/Makefile.orig        Wed Aug 11 13:38:31 2004
--- ./contrib/tips/Makefile     Wed Aug 11 13:57:11 2004
***************
*** 2,9 ****
  
  subdir = contrib/tips
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  DOCS = README.apachelog
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 2,8 ----
  
  subdir = contrib/tips
  top_builddir = ../..
  
  DOCS = README.apachelog
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/tsearch/Makefile.orig     Wed Aug 11 13:38:31 2004
--- ./contrib/tsearch/Makefile  Wed Aug 11 13:57:39 2004
***************
*** 2,8 ****
  
  subdir = contrib/tsearch
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  override CPPFLAGS := -I. $(CPPFLAGS)
  
--- 2,7 ----
***************
*** 13,18 ****
--- 12,21 ----
  DOCS = README.tsearch
  REGRESS = tsearch
  
+ EXTRA_CLEAN = parser.c
+ 
+ include $(top_builddir)/contrib/contrib-global.mk
+ 
  # 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
--- 26,29 ----
*** ./contrib/tsearch2/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/tsearch2/Makefile Wed Aug 11 13:58:33 2004
***************
*** 2,9 ****
  
  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 \
--- 2,7 ----
***************
*** 17,27 ****
  
  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
--- 15,20 ----
***************
*** 31,36 ****
--- 24,38 ----
  
  SHLIB_LINK := -lm
  
+ 
+ include $(top_builddir)/contrib/contrib-global.mk
+ 
+ 
+ $(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
--- 45,47 ----
*** ./contrib/userlock/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/userlock/Makefile Wed Aug 11 13:58:44 2004
***************
*** 2,11 ****
  
  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
--- 2,10 ----
  
  subdir = contrib/userlock
  top_builddir = ../..
  
  MODULES = user_locks
  DATA_built = user_locks.sql
  DOCS = README.user_locks
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/vacuumlo/Makefile.orig    Wed Aug 11 13:38:31 2004
--- ./contrib/vacuumlo/Makefile Wed Aug 11 13:58:55 2004
***************
*** 2,8 ****
  
  subdir = contrib/vacuumlo
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  PROGRAM = vacuumlo
  OBJS  = vacuumlo.o
--- 2,7 ----
***************
*** 12,15 ****
  
  DOCS = README.vacuumlo
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 11,14 ----
  
  DOCS = README.vacuumlo
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/xml/Makefile.orig Wed Aug 11 13:38:31 2004
--- ./contrib/xml/Makefile      Wed Aug 11 13:59:06 2004
***************
*** 2,8 ****
  
  subdir = contrib/xml
  top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
  
  MODULE_big = pgxml_dom
  OBJS = pgxml_dom.o
--- 2,7 ----
***************
*** 10,13 ****
  DATA_built = pgxml_dom.sql
  DOCS = README.xml
  
! include $(top_srcdir)/contrib/contrib-global.mk
--- 9,12 ----
  DATA_built = pgxml_dom.sql
  DOCS = README.xml
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./contrib/xml2/Makefile.orig        Wed Aug 11 13:38:31 2004
--- ./contrib/xml2/Makefile     Wed Aug 11 13:59:32 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,6 ----
  # This makefile will build the new XML and XSLT routines.
  subdir = contrib/xml2
! top_builddir = ../..
  
  MODULE_big = pgxml
  
***************
*** 14,18 ****
  DATA_built = pgxml.sql
  DOCS = README.xml2
  
! include $(top_builddir)contrib/contrib-global.mk
! 
--- 13,16 ----
  DATA_built = pgxml.sql
  DOCS = README.xml2
  
! include $(top_builddir)/contrib/contrib-global.mk
*** ./src/Makefile.global.in.orig       Tue Aug 10 08:29:03 2004
--- ./src/Makefile.global.in    Wed Aug 11 15:21:23 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:
*** ./src/Makefile.orig Tue Aug 10 08:29:03 2004
--- ./src/Makefile      Wed Aug 11 15:22:25 2004
***************
*** 35,40 ****
--- 35,41 ----
  
  install-all-headers:
        $(MAKE) -C include $@
+       $(MAKE) -C port $@
  
  installdirs: installdirs-local
  
*** ./src/makefiles/pgxs.mk.orig        Fri Jul 30 14:26:40 2004
--- ./src/makefiles/pgxs.mk     Wed Aug 11 14:55:56 2004
***************
*** 50,63 ****
  
  ifdef PGXS
  # We assume that we are in src/makefiles/, so top is ...
! top_builddir := $(dir $(PGXS))/../..
! include $(top_builddir)/src/Makefile.global
! 
! top_srcdir = $(top_builddir)
  srcdir = .
  VPATH =
  endif
  
  
  override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
  
--- 50,61 ----
  
  ifdef PGXS
  # We assume that we are in src/makefiles/, so top is ...
! top_builddir := $(dir $(PGXS))../..
  srcdir = .
  VPATH =
  endif
  
+ include $(top_builddir)/src/Makefile.global
  
  override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
  
*** ./src/port/Makefile.orig    Tue Aug 10 08:29:13 2004
--- ./src/port/Makefile Wed Aug 11 15:30:08 2004
***************
*** 20,25 ****
--- 20,30 ----
  
  all: libpgport.a
  
+ # libpgport is needed by some contrib
+ NAME=pgport
+ include $(top_builddir)/src/Makefile.shlib
+ install-all-headers: install-lib
+ 
  libpgport.a: $(LIBOBJS)
        $(AR) $(AROPT) $@ $^
  
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to