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
PG_CPPFLAGS = -I$(libpq_srcdir)
......@@ -8,7 +8,8 @@ DOCS = README.adminpack
OBJS = adminpack.o
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
......@@ -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
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = chkpass.o
......@@ -8,7 +8,8 @@ DATA = uninstall_chkpass.sql
DOCS = README.chkpass
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS= cube.o cubeparse.o
......@@ -13,7 +13,8 @@ EXTRA_CLEAN = y.tab.c y.tab.h
SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
PG_CPPFLAGS = -I$(libpq_srcdir)
......@@ -12,7 +12,8 @@ REGRESS = dblink
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
DATA_built = earthdistance.sql
......@@ -9,7 +9,8 @@ REGRESS = earthdistance
SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = fuzzystrmatch.o dmetaphone.o
......@@ -7,7 +7,8 @@ DATA = uninstall_fuzzystrmatch.sql
DOCS = README.fuzzystrmatch README.soundex
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/fuzzystrmatch
......
......@@ -2,7 +2,7 @@
# Makefile for integer aggregator
# Copyright (C) 2001 Digital Music Network.
# 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
DATA_built = int_aggregate.sql
......@@ -10,7 +10,8 @@ DATA = uninstall_int_aggregate.sql
DOCS = README.int_aggregate
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
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
REGRESS = _int
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
DATA_built = isn.sql
......@@ -6,7 +6,8 @@ DATA = uninstall_isn.sql
DOCS = README.isn
ifdef USE_PGXS
PGXS = $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
DATA_built = lo.sql
......@@ -6,7 +6,8 @@ DATA = uninstall_lo.sql
DOCS = README.lo
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
MODULE_big = ltree
......@@ -10,7 +10,8 @@ DOCS = README.ltree
REGRESS = ltree
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = oid2name.o
......@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.oid2name
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/oid2name
......
......@@ -2,7 +2,7 @@
#
# 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
DATA = uninstall_pageinspect.sql
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = pg_buffercache_pages.o
......@@ -8,7 +8,8 @@ DATA = uninstall_pg_buffercache.sql
DOCS = README.pg_buffercache
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = pg_freespacemap.o
......@@ -8,7 +8,8 @@ DATA = uninstall_pg_freespacemap.sql
DOCS = README.pg_freespacemap
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = pg_standby.o
......@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.pg_standby
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pg_standby
......
......@@ -19,7 +19,6 @@
* Current maintainer: Simon Riggs
*/
#include "postgres_fe.h"
#include "pg_config_manual.h"
#include <ctype.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
OBJS = trgm_op.o trgm_gist.o trgm_gin.o
......@@ -10,7 +10,8 @@ REGRESS = pg_trgm
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = pgbench.o
......@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.pgbench README.pgbench_jis
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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 \
......@@ -39,7 +39,8 @@ REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pgcrypto
......
......@@ -2,7 +2,7 @@
#
# 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
DATA = uninstall_pgrowlocks.sql
ifdef USE_PGXS
PGXS = $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pgrowlocks
......
......@@ -2,7 +2,7 @@
#
# 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
DATA = uninstall_pgstattuple.sql
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = seg.o segparse.o
......@@ -10,7 +10,8 @@ REGRESS = seg
EXTRA_CLEAN = y.tab.c y.tab.h
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
DATA_built = $(addsuffix .sql, $(MODULES))
......@@ -9,7 +9,8 @@ DOCS = README.spi $(addsuffix .example, $(MODULES))
PG_CPPFLAGS = -DREFINT_VERBOSE
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = sslinfo.o
......@@ -7,7 +7,8 @@ DATA = uninstall_sslinfo.sql
DOCS = README.sslinfo
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
DATA_built = tablefunc.sql
......@@ -9,7 +9,8 @@ REGRESS = tablefunc
SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = dict_ex.o dict.o snmap.o stopword.o common.o prs_dcfg.o \
......@@ -25,7 +25,8 @@ SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
......@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
PG_CPPFLAGS = -I$(srcdir)/..
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
......@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
PG_CPPFLAGS = -I$(srcdir)/..
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
......@@ -7,7 +7,8 @@ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
PG_CPPFLAGS = -I$(srcdir)/..
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = uuid-ossp.o
......@@ -9,7 +9,8 @@ DOCS = README.uuid-ossp
SHLIB_LINK += -lossp-uuid
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
OBJS = vacuumlo.o
......@@ -9,7 +9,8 @@ PG_LIBS = $(libpq_pgport)
DOCS = README.vacuumlo
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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
......@@ -15,7 +15,8 @@ DOCS = README.xml2
override CFLAGS += $(shell xml2-config --cflags)
ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
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">
<title>User-Defined Functions</title>
......@@ -2071,10 +2071,11 @@ MODULES = isbn_issn
DATA_built = isbn_issn.sql
DOCS = README.isbn_issn
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
</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
<application>make</application> rules.
</para>
......@@ -2215,6 +2216,18 @@ include $(PGXS)
</para>
</listitem>
</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>
</para>
......@@ -2222,13 +2235,26 @@ include $(PGXS)
Put this makefile as <literal>Makefile</literal> in the directory
which holds your extension. Then you can do
<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
<productname>PostgreSQL</productname> installation that
corresponds to the first <command>pg_config</command> command
found in your path.
corresponds to the first <command>pg_config</command> program
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>
</caution>
<para>
The scripts listed in the <varname>REGRESS</> variable are used for
regression testing of your module, just like <literal>make
......
# -*-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,
......@@ -118,7 +118,10 @@ localedir := @localedir@
else # PGXS case
# Extension makefiles should set PG_CONFIG, but older ones might not
ifndef PG_CONFIG
PG_CONFIG = pg_config
endif
bindir := $(shell $(PG_CONFIG) --bindir)
datadir := $(shell $(PG_CONFIG) --sharedir)
......
# 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
# extension modules. You only need to set a few variables and include
......@@ -11,7 +11,8 @@
# [variable assignments, see below]
# [custom rules, rarely necessary]
#
# PGXS := $(shell pg_config --pgxs)
# PG_CONFIG = pg_config
# PGXS := $(shell $(PG_CONFIG) --pgxs)
# include $(PGXS)
#
# The following variables can be set:
......@@ -38,6 +39,9 @@
# PG_CPPFLAGS -- will be added to CPPFLAGS
# PG_LIBS -- will be added to PROGRAM link line
# SHLIB_LINK -- will be added to MODULE_big link line
# 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...
......
......@@ -9,7 +9,7 @@
# to build using the surrounding source tree.
#
# 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 = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/src/makefiles/pgxs.mk
else
PGXS := $(shell pg_config --pgxs)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
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