Commit b09c248b authored by Tom Lane's avatar Tom Lane

Fix PGXS conventions so that extensions can be built against Postgres

installations whose pg_config program does not appear first in the PATH.
Per gripe from Eddie Stanley and subsequent discussions with Fabien Coelho
and others.
parent 80f3b5ad
# $PostgreSQL: pgsql/contrib/adminpack/Makefile,v 1.4 2007/02/09 17:03:59 petere Exp $ # $PostgreSQL: pgsql/contrib/adminpack/Makefile,v 1.5 2007/06/26 22:05:01 tgl Exp $
MODULE_big = adminpack MODULE_big = adminpack
PG_CPPFLAGS = -I$(libpq_srcdir) PG_CPPFLAGS = -I$(libpq_srcdir)
...@@ -8,7 +8,8 @@ DOCS = README.adminpack ...@@ -8,7 +8,8 @@ DOCS = README.adminpack
OBJS = adminpack.o OBJS = adminpack.o
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/adminpack subdir = contrib/adminpack
......
# $PostgreSQL: pgsql/contrib/btree_gist/Makefile,v 1.10 2007/02/09 17:03:59 petere Exp $ # $PostgreSQL: pgsql/contrib/btree_gist/Makefile,v 1.11 2007/06/26 22:05:01 tgl Exp $
MODULE_big = btree_gist MODULE_big = btree_gist
...@@ -15,7 +15,8 @@ REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp timestamptz t ...@@ -15,7 +15,8 @@ REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp timestamptz t
date interval macaddr inet cidr text varchar char bytea bit varbit numeric date interval macaddr inet cidr text varchar char bytea bit varbit numeric
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/btree_gist subdir = contrib/btree_gist
......
# $PostgreSQL: pgsql/contrib/chkpass/Makefile,v 1.8 2006/02/27 12:54:38 petere Exp $ # $PostgreSQL: pgsql/contrib/chkpass/Makefile,v 1.9 2007/06/26 22:05:01 tgl Exp $
MODULE_big = chkpass MODULE_big = chkpass
OBJS = chkpass.o OBJS = chkpass.o
...@@ -8,7 +8,8 @@ DATA = uninstall_chkpass.sql ...@@ -8,7 +8,8 @@ DATA = uninstall_chkpass.sql
DOCS = README.chkpass DOCS = README.chkpass
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/chkpass subdir = contrib/chkpass
......
# $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.19 2007/02/09 17:24:33 petere Exp $ # $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.20 2007/06/26 22:05:01 tgl Exp $
MODULE_big = cube MODULE_big = cube
OBJS= cube.o cubeparse.o OBJS= cube.o cubeparse.o
...@@ -13,7 +13,8 @@ EXTRA_CLEAN = y.tab.c y.tab.h ...@@ -13,7 +13,8 @@ EXTRA_CLEAN = y.tab.c y.tab.h
SHLIB_LINK += $(filter -lm, $(LIBS)) SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/cube subdir = contrib/cube
......
# $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.13 2006/09/10 22:07:02 tgl Exp $ # $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.14 2007/06/26 22:05:01 tgl Exp $
MODULE_big = dblink MODULE_big = dblink
PG_CPPFLAGS = -I$(libpq_srcdir) PG_CPPFLAGS = -I$(libpq_srcdir)
...@@ -12,7 +12,8 @@ REGRESS = dblink ...@@ -12,7 +12,8 @@ REGRESS = dblink
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/dblink subdir = contrib/dblink
......
# $PostgreSQL: pgsql/contrib/earthdistance/Makefile,v 1.17 2006/02/27 12:54:38 petere Exp $ # $PostgreSQL: pgsql/contrib/earthdistance/Makefile,v 1.18 2007/06/26 22:05:02 tgl Exp $
MODULES = earthdistance MODULES = earthdistance
DATA_built = earthdistance.sql DATA_built = earthdistance.sql
...@@ -9,7 +9,8 @@ REGRESS = earthdistance ...@@ -9,7 +9,8 @@ REGRESS = earthdistance
SHLIB_LINK += $(filter -lm, $(LIBS)) SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/earthdistance subdir = contrib/earthdistance
......
# $PostgreSQL: pgsql/contrib/fuzzystrmatch/Makefile,v 1.8 2006/10/19 17:40:03 tgl Exp $ # $PostgreSQL: pgsql/contrib/fuzzystrmatch/Makefile,v 1.9 2007/06/26 22:05:02 tgl Exp $
MODULE_big = fuzzystrmatch MODULE_big = fuzzystrmatch
OBJS = fuzzystrmatch.o dmetaphone.o OBJS = fuzzystrmatch.o dmetaphone.o
...@@ -7,7 +7,8 @@ DATA = uninstall_fuzzystrmatch.sql ...@@ -7,7 +7,8 @@ DATA = uninstall_fuzzystrmatch.sql
DOCS = README.fuzzystrmatch README.soundex DOCS = README.fuzzystrmatch README.soundex
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/fuzzystrmatch subdir = contrib/fuzzystrmatch
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for integer aggregator # Makefile for integer aggregator
# Copyright (C) 2001 Digital Music Network. # Copyright (C) 2001 Digital Music Network.
# by Mark L. Woodward # by Mark L. Woodward
# $PostgreSQL: pgsql/contrib/intagg/Makefile,v 1.7 2006/02/27 12:54:39 petere Exp $ # $PostgreSQL: pgsql/contrib/intagg/Makefile,v 1.8 2007/06/26 22:05:02 tgl Exp $
MODULES = int_aggregate MODULES = int_aggregate
DATA_built = int_aggregate.sql DATA_built = int_aggregate.sql
...@@ -10,7 +10,8 @@ DATA = uninstall_int_aggregate.sql ...@@ -10,7 +10,8 @@ DATA = uninstall_int_aggregate.sql
DOCS = README.int_aggregate DOCS = README.int_aggregate
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/intagg subdir = contrib/intagg
......
# $PostgreSQL: pgsql/contrib/intarray/Makefile,v 1.14 2006/05/03 16:31:07 teodor Exp $ # $PostgreSQL: pgsql/contrib/intarray/Makefile,v 1.15 2007/06/26 22:05:02 tgl Exp $
MODULE_big = _int MODULE_big = _int
OBJS = _int_bool.o _int_gist.o _int_op.o _int_tool.o _intbig_gist.o _int_gin.o OBJS = _int_bool.o _int_gist.o _int_op.o _int_tool.o _intbig_gist.o _int_gin.o
...@@ -8,7 +8,8 @@ DOCS = README.intarray ...@@ -8,7 +8,8 @@ DOCS = README.intarray
REGRESS = _int REGRESS = _int
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/intarray subdir = contrib/intarray
......
# $PostgreSQL: pgsql/contrib/isn/Makefile,v 1.1 2006/09/09 04:07:52 tgl Exp $ # $PostgreSQL: pgsql/contrib/isn/Makefile,v 1.2 2007/06/26 22:05:02 tgl Exp $
MODULES = isn MODULES = isn
DATA_built = isn.sql DATA_built = isn.sql
...@@ -6,7 +6,8 @@ DATA = uninstall_isn.sql ...@@ -6,7 +6,8 @@ DATA = uninstall_isn.sql
DOCS = README.isn DOCS = README.isn
ifdef USE_PGXS ifdef USE_PGXS
PGXS = $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/isn subdir = contrib/isn
......
# $PostgreSQL: pgsql/contrib/lo/Makefile,v 1.15 2006/09/11 15:14:46 tgl Exp $ # $PostgreSQL: pgsql/contrib/lo/Makefile,v 1.16 2007/06/26 22:05:02 tgl Exp $
MODULES = lo MODULES = lo
DATA_built = lo.sql DATA_built = lo.sql
...@@ -6,7 +6,8 @@ DATA = uninstall_lo.sql ...@@ -6,7 +6,8 @@ DATA = uninstall_lo.sql
DOCS = README.lo DOCS = README.lo
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/lo subdir = contrib/lo
......
# $PostgreSQL: pgsql/contrib/ltree/Makefile,v 1.6 2007/02/09 17:04:00 petere Exp $ # $PostgreSQL: pgsql/contrib/ltree/Makefile,v 1.7 2007/06/26 22:05:02 tgl Exp $
PG_CPPFLAGS = -DLOWER_NODE PG_CPPFLAGS = -DLOWER_NODE
MODULE_big = ltree MODULE_big = ltree
...@@ -10,7 +10,8 @@ DOCS = README.ltree ...@@ -10,7 +10,8 @@ DOCS = README.ltree
REGRESS = ltree REGRESS = ltree
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/ltree subdir = contrib/ltree
......
# $PostgreSQL: pgsql/contrib/oid2name/Makefile,v 1.8 2005/09/27 17:13:06 tgl Exp $ # $PostgreSQL: pgsql/contrib/oid2name/Makefile,v 1.9 2007/06/26 22:05:02 tgl Exp $
PROGRAM = oid2name PROGRAM = oid2name
OBJS = oid2name.o OBJS = oid2name.o
...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport) ...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.oid2name DOCS = README.oid2name
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/oid2name subdir = contrib/oid2name
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# pageinspect Makefile # pageinspect Makefile
# #
# $PostgreSQL: pgsql/contrib/pageinspect/Makefile,v 1.1 2007/05/17 19:11:24 momjian Exp $ # $PostgreSQL: pgsql/contrib/pageinspect/Makefile,v 1.2 2007/06/26 22:05:02 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,7 +13,8 @@ DATA_built = pageinspect.sql ...@@ -13,7 +13,8 @@ DATA_built = pageinspect.sql
DATA = uninstall_pageinspect.sql DATA = uninstall_pageinspect.sql
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pageinspect subdir = contrib/pageinspect
......
# $PostgreSQL: pgsql/contrib/pg_buffercache/Makefile,v 1.3 2006/02/27 12:54:39 petere Exp $ # $PostgreSQL: pgsql/contrib/pg_buffercache/Makefile,v 1.4 2007/06/26 22:05:02 tgl Exp $
MODULE_big = pg_buffercache MODULE_big = pg_buffercache
OBJS = pg_buffercache_pages.o OBJS = pg_buffercache_pages.o
...@@ -8,7 +8,8 @@ DATA = uninstall_pg_buffercache.sql ...@@ -8,7 +8,8 @@ DATA = uninstall_pg_buffercache.sql
DOCS = README.pg_buffercache DOCS = README.pg_buffercache
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pg_buffercache subdir = contrib/pg_buffercache
......
# $PostgreSQL: pgsql/contrib/pg_freespacemap/Makefile,v 1.2 2006/09/30 18:15:48 tgl Exp $ # $PostgreSQL: pgsql/contrib/pg_freespacemap/Makefile,v 1.3 2007/06/26 22:05:02 tgl Exp $
MODULE_big = pg_freespacemap MODULE_big = pg_freespacemap
OBJS = pg_freespacemap.o OBJS = pg_freespacemap.o
...@@ -8,7 +8,8 @@ DATA = uninstall_pg_freespacemap.sql ...@@ -8,7 +8,8 @@ DATA = uninstall_pg_freespacemap.sql
DOCS = README.pg_freespacemap DOCS = README.pg_freespacemap
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pg_freespacemap subdir = contrib/pg_freespacemap
......
# $PostgreSQL: pgsql/contrib/pg_standby/Makefile,v 1.2 2007/02/09 17:04:00 petere Exp $ # $PostgreSQL: pgsql/contrib/pg_standby/Makefile,v 1.3 2007/06/26 22:05:02 tgl Exp $
PROGRAM = pg_standby PROGRAM = pg_standby
OBJS = pg_standby.o OBJS = pg_standby.o
...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport) ...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.pg_standby DOCS = README.pg_standby
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pg_standby subdir = contrib/pg_standby
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* Current maintainer: Simon Riggs * Current maintainer: Simon Riggs
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "pg_config_manual.h"
#include <ctype.h> #include <ctype.h>
#include <dirent.h> #include <dirent.h>
......
# $PostgreSQL: pgsql/contrib/pg_trgm/Makefile,v 1.7 2007/03/14 14:15:40 teodor Exp $ # $PostgreSQL: pgsql/contrib/pg_trgm/Makefile,v 1.8 2007/06/26 22:05:02 tgl Exp $
MODULE_big = pg_trgm MODULE_big = pg_trgm
OBJS = trgm_op.o trgm_gist.o trgm_gin.o OBJS = trgm_op.o trgm_gist.o trgm_gin.o
...@@ -10,7 +10,8 @@ REGRESS = pg_trgm ...@@ -10,7 +10,8 @@ REGRESS = pg_trgm
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pg_trgm subdir = contrib/pg_trgm
......
# $PostgreSQL: pgsql/contrib/pgbench/Makefile,v 1.14 2005/09/27 17:13:08 tgl Exp $ # $PostgreSQL: pgsql/contrib/pgbench/Makefile,v 1.15 2007/06/26 22:05:03 tgl Exp $
PROGRAM = pgbench PROGRAM = pgbench
OBJS = pgbench.o OBJS = pgbench.o
...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport) ...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.pgbench README.pgbench_jis DOCS = README.pgbench README.pgbench_jis
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pgbench subdir = contrib/pgbench
......
# #
# $PostgreSQL: pgsql/contrib/pgcrypto/Makefile,v 1.25 2007/01/14 20:55:14 alvherre Exp $ # $PostgreSQL: pgsql/contrib/pgcrypto/Makefile,v 1.26 2007/06/26 22:05:03 tgl Exp $
# #
INT_SRCS = md5.c sha1.c sha2.c internal.c internal-sha2.c blf.c rijndael.c \ INT_SRCS = md5.c sha1.c sha2.c internal.c internal-sha2.c blf.c rijndael.c \
...@@ -39,7 +39,8 @@ REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \ ...@@ -39,7 +39,8 @@ REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pgcrypto subdir = contrib/pgcrypto
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# pgrowlocks Makefile # pgrowlocks Makefile
# #
# $PostgreSQL: pgsql/contrib/pgrowlocks/Makefile,v 1.3 2006/10/19 17:40:03 tgl Exp $ # $PostgreSQL: pgsql/contrib/pgrowlocks/Makefile,v 1.4 2007/06/26 22:05:03 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,7 +13,8 @@ DATA_built = pgrowlocks.sql ...@@ -13,7 +13,8 @@ DATA_built = pgrowlocks.sql
DATA = uninstall_pgrowlocks.sql DATA = uninstall_pgrowlocks.sql
ifdef USE_PGXS ifdef USE_PGXS
PGXS = $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pgrowlocks subdir = contrib/pgrowlocks
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# pgstattuple Makefile # pgstattuple Makefile
# #
# $PostgreSQL: pgsql/contrib/pgstattuple/Makefile,v 1.7 2006/10/19 17:40:03 tgl Exp $ # $PostgreSQL: pgsql/contrib/pgstattuple/Makefile,v 1.8 2007/06/26 22:05:03 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,7 +13,8 @@ DATA_built = pgstattuple.sql ...@@ -13,7 +13,8 @@ DATA_built = pgstattuple.sql
DATA = uninstall_pgstattuple.sql DATA = uninstall_pgstattuple.sql
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/pgstattuple subdir = contrib/pgstattuple
......
# $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.18 2007/02/09 17:24:33 petere Exp $ # $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.19 2007/06/26 22:05:03 tgl Exp $
MODULE_big = seg MODULE_big = seg
OBJS = seg.o segparse.o OBJS = seg.o segparse.o
...@@ -10,7 +10,8 @@ REGRESS = seg ...@@ -10,7 +10,8 @@ REGRESS = seg
EXTRA_CLEAN = y.tab.c y.tab.h EXTRA_CLEAN = y.tab.c y.tab.h
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/seg subdir = contrib/seg
......
# $PostgreSQL: pgsql/contrib/spi/Makefile,v 1.26 2005/09/27 17:13:10 tgl Exp $ # $PostgreSQL: pgsql/contrib/spi/Makefile,v 1.27 2007/06/26 22:05:03 tgl Exp $
MODULES = autoinc insert_username moddatetime refint timetravel MODULES = autoinc insert_username moddatetime refint timetravel
DATA_built = $(addsuffix .sql, $(MODULES)) DATA_built = $(addsuffix .sql, $(MODULES))
...@@ -9,7 +9,8 @@ DOCS = README.spi $(addsuffix .example, $(MODULES)) ...@@ -9,7 +9,8 @@ DOCS = README.spi $(addsuffix .example, $(MODULES))
PG_CPPFLAGS = -DREFINT_VERBOSE PG_CPPFLAGS = -DREFINT_VERBOSE
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/spi subdir = contrib/spi
......
# $PostgreSQL: pgsql/contrib/sslinfo/Makefile,v 1.8 2007/02/09 17:04:00 petere Exp $ # $PostgreSQL: pgsql/contrib/sslinfo/Makefile,v 1.9 2007/06/26 22:05:03 tgl Exp $
MODULE_big = sslinfo MODULE_big = sslinfo
OBJS = sslinfo.o OBJS = sslinfo.o
...@@ -7,7 +7,8 @@ DATA = uninstall_sslinfo.sql ...@@ -7,7 +7,8 @@ DATA = uninstall_sslinfo.sql
DOCS = README.sslinfo DOCS = README.sslinfo
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/sslinfo subdir = contrib/sslinfo
......
# $PostgreSQL: pgsql/contrib/tablefunc/Makefile,v 1.7 2007/02/09 17:04:00 petere Exp $ # $PostgreSQL: pgsql/contrib/tablefunc/Makefile,v 1.8 2007/06/26 22:05:03 tgl Exp $
MODULES = tablefunc MODULES = tablefunc
DATA_built = tablefunc.sql DATA_built = tablefunc.sql
...@@ -9,7 +9,8 @@ REGRESS = tablefunc ...@@ -9,7 +9,8 @@ REGRESS = tablefunc
SHLIB_LINK += $(filter -lm, $(LIBS)) SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/tablefunc subdir = contrib/tablefunc
......
# $PostgreSQL: pgsql/contrib/tsearch2/Makefile,v 1.18 2007/02/09 15:55:57 petere Exp $ # $PostgreSQL: pgsql/contrib/tsearch2/Makefile,v 1.19 2007/06/26 22:05:03 tgl Exp $
MODULE_big = tsearch2 MODULE_big = tsearch2
OBJS = dict_ex.o dict.o snmap.o stopword.o common.o prs_dcfg.o \ OBJS = dict_ex.o dict.o snmap.o stopword.o common.o prs_dcfg.o \
...@@ -25,7 +25,8 @@ SHLIB_LINK += $(filter -lm, $(LIBS)) ...@@ -25,7 +25,8 @@ SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/tsearch2 subdir = contrib/tsearch2
......
# $PostgreSQL: pgsql/contrib/tsearch2/ispell/Makefile,v 1.9 2005/10/18 01:30:48 tgl Exp $ # $PostgreSQL: pgsql/contrib/tsearch2/ispell/Makefile,v 1.10 2007/06/26 22:05:03 tgl Exp $
SUBOBJS = spell.o regis.o SUBOBJS = spell.o regis.o
...@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS) ...@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
PG_CPPFLAGS = -I$(srcdir)/.. PG_CPPFLAGS = -I$(srcdir)/..
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/tsearch2/ispell subdir = contrib/tsearch2/ispell
......
# $PostgreSQL: pgsql/contrib/tsearch2/snowball/Makefile,v 1.9 2006/01/27 16:32:31 teodor Exp $ # $PostgreSQL: pgsql/contrib/tsearch2/snowball/Makefile,v 1.10 2007/06/26 22:05:03 tgl Exp $
SUBOBJS = english_stem.o api.o russian_stem.o russian_stem_UTF8.o utilities.o SUBOBJS = english_stem.o api.o russian_stem.o russian_stem_UTF8.o utilities.o
...@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS) ...@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
PG_CPPFLAGS = -I$(srcdir)/.. PG_CPPFLAGS = -I$(srcdir)/..
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/tsearch2/snowball subdir = contrib/tsearch2/snowball
......
# $PostgreSQL: pgsql/contrib/tsearch2/wordparser/Makefile,v 1.9 2005/11/21 12:27:57 teodor Exp $ # $PostgreSQL: pgsql/contrib/tsearch2/wordparser/Makefile,v 1.10 2007/06/26 22:05:03 tgl Exp $
SUBOBJS = parser.o deflex.o SUBOBJS = parser.o deflex.o
...@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS) ...@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
PG_CPPFLAGS = -I$(srcdir)/.. PG_CPPFLAGS = -I$(srcdir)/..
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/tsearch2/wordparser subdir = contrib/tsearch2/wordparser
......
# $PostgreSQL: pgsql/contrib/uuid-ossp/Makefile,v 1.1 2007/04/21 17:26:17 petere Exp $ # $PostgreSQL: pgsql/contrib/uuid-ossp/Makefile,v 1.2 2007/06/26 22:05:03 tgl Exp $
MODULE_big = uuid-ossp MODULE_big = uuid-ossp
OBJS = uuid-ossp.o OBJS = uuid-ossp.o
...@@ -9,7 +9,8 @@ DOCS = README.uuid-ossp ...@@ -9,7 +9,8 @@ DOCS = README.uuid-ossp
SHLIB_LINK += -lossp-uuid SHLIB_LINK += -lossp-uuid
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/uuid-ossp subdir = contrib/uuid-ossp
......
# $PostgreSQL: pgsql/contrib/vacuumlo/Makefile,v 1.15 2005/09/27 17:13:13 tgl Exp $ # $PostgreSQL: pgsql/contrib/vacuumlo/Makefile,v 1.16 2007/06/26 22:05:03 tgl Exp $
PROGRAM = vacuumlo PROGRAM = vacuumlo
OBJS = vacuumlo.o OBJS = vacuumlo.o
...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport) ...@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.vacuumlo DOCS = README.vacuumlo
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/vacuumlo subdir = contrib/vacuumlo
......
# $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.9 2007/02/09 17:04:00 petere Exp $ # $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.10 2007/06/26 22:05:04 tgl Exp $
MODULE_big = pgxml MODULE_big = pgxml
...@@ -15,7 +15,8 @@ DOCS = README.xml2 ...@@ -15,7 +15,8 @@ DOCS = README.xml2
override CFLAGS += $(shell xml2-config --cflags) override CFLAGS += $(shell xml2-config --cflags)
ifdef USE_PGXS ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
subdir = contrib/xml2 subdir = contrib/xml2
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.128 2007/06/06 23:00:36 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.129 2007/06/26 22:05:04 tgl Exp $ -->
<sect1 id="xfunc"> <sect1 id="xfunc">
<title>User-Defined Functions</title> <title>User-Defined Functions</title>
...@@ -2071,10 +2071,11 @@ MODULES = isbn_issn ...@@ -2071,10 +2071,11 @@ MODULES = isbn_issn
DATA_built = isbn_issn.sql DATA_built = isbn_issn.sql
DOCS = README.isbn_issn DOCS = README.isbn_issn
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
</programlisting> </programlisting>
The last two lines should always be the same. Earlier in the The last three lines should always be the same. Earlier in the
file, you assign variables or add custom file, you assign variables or add custom
<application>make</application> rules. <application>make</application> rules.
</para> </para>
...@@ -2215,6 +2216,18 @@ include $(PGXS) ...@@ -2215,6 +2216,18 @@ include $(PGXS)
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>PG_CONFIG</varname></term>
<listitem>
<para>
path to <application>pg_config</> program for the
<productname>PostgreSQL</productname> installation to build against
(typically just <literal>pg_config</> to use the first one in your
<varname>PATH</>)
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
...@@ -2222,12 +2235,25 @@ include $(PGXS) ...@@ -2222,12 +2235,25 @@ include $(PGXS)
Put this makefile as <literal>Makefile</literal> in the directory Put this makefile as <literal>Makefile</literal> in the directory
which holds your extension. Then you can do which holds your extension. Then you can do
<literal>make</literal> to compile, and later <literal>make <literal>make</literal> to compile, and later <literal>make
install</literal> to install your module. The extension is install</literal> to install your module. By default, the extension is
compiled and installed for the compiled and installed for the
<productname>PostgreSQL</productname> installation that <productname>PostgreSQL</productname> installation that
corresponds to the first <command>pg_config</command> command corresponds to the first <command>pg_config</command> program
found in your path. found in your path. You can use a different installation by
setting <varname>PG_CONFIG</varname> to point to its
<command>pg_config</command> program, either within the makefile
or on the <literal>make</literal> command line.
</para>
<caution>
<para>
Changing <varname>PG_CONFIG</varname> only works when building
against <productname>PostgreSQL</productname> 8.3 or later.
With older releases it does not work to set it to anything except
<literal>pg_config</>; you must alter your <varname>PATH</>
to select the installation to build against.
</para> </para>
</caution>
<para> <para>
The scripts listed in the <varname>REGRESS</> variable are used for The scripts listed in the <varname>REGRESS</> variable are used for
......
# -*-makefile-*- # -*-makefile-*-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.236 2007/04/21 17:26:18 petere Exp $ # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.237 2007/06/26 22:05:04 tgl Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets, # All PostgreSQL makefiles include this file and use the variables it sets,
...@@ -118,7 +118,10 @@ localedir := @localedir@ ...@@ -118,7 +118,10 @@ localedir := @localedir@
else # PGXS case else # PGXS case
# Extension makefiles should set PG_CONFIG, but older ones might not
ifndef PG_CONFIG
PG_CONFIG = pg_config PG_CONFIG = pg_config
endif
bindir := $(shell $(PG_CONFIG) --bindir) bindir := $(shell $(PG_CONFIG) --bindir)
datadir := $(shell $(PG_CONFIG) --sharedir) datadir := $(shell $(PG_CONFIG) --sharedir)
......
# PGXS: PostgreSQL extensions makefile # PGXS: PostgreSQL extensions makefile
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.9 2006/07/21 00:24:04 tgl Exp $ # $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.10 2007/06/26 22:05:04 tgl Exp $
# This file contains generic rules to build many kinds of simple # This file contains generic rules to build many kinds of simple
# extension modules. You only need to set a few variables and include # extension modules. You only need to set a few variables and include
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
# [variable assignments, see below] # [variable assignments, see below]
# [custom rules, rarely necessary] # [custom rules, rarely necessary]
# #
# PGXS := $(shell pg_config --pgxs) # PG_CONFIG = pg_config
# PGXS := $(shell $(PG_CONFIG) --pgxs)
# include $(PGXS) # include $(PGXS)
# #
# The following variables can be set: # The following variables can be set:
...@@ -38,6 +39,9 @@ ...@@ -38,6 +39,9 @@
# PG_CPPFLAGS -- will be added to CPPFLAGS # PG_CPPFLAGS -- will be added to CPPFLAGS
# PG_LIBS -- will be added to PROGRAM link line # PG_LIBS -- will be added to PROGRAM link line
# SHLIB_LINK -- will be added to MODULE_big link line # SHLIB_LINK -- will be added to MODULE_big link line
# PG_CONFIG -- path to pg_config program for the PostgreSQL installation
# to build against (typically just "pg_config" to use the first one in
# your PATH)
# #
# Better look at some of the existing uses for examples... # Better look at some of the existing uses for examples...
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# to build using the surrounding source tree. # to build using the surrounding source tree.
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.19 2005/09/27 17:13:14 tgl Exp $ # $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.20 2007/06/26 22:05:04 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -24,7 +24,8 @@ top_builddir = ../.. ...@@ -24,7 +24,8 @@ top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/src/makefiles/pgxs.mk include $(top_srcdir)/src/makefiles/pgxs.mk
else else
PGXS := $(shell pg_config --pgxs) PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
endif endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment