aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-26 22:05:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-26 22:05:04 +0000
commitb09c248bdd3d0d86714865d2142604aea789e840 (patch)
tree382d314f0df7e8cd877d8d0e554c199c24833b36 /src
parent80f3b5ad2e294b16f1c179a8c6cde98ee5fb3a53 (diff)
downloadpostgresql-b09c248bdd3d0d86714865d2142604aea789e840.tar.gz
postgresql-b09c248bdd3d0d86714865d2142604aea789e840.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in5
-rw-r--r--src/makefiles/pgxs.mk8
-rw-r--r--src/tutorial/Makefile5
3 files changed, 13 insertions, 5 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 604d7bbc67f..032da4f5791 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
# -*-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)
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 1a0fa54c6ef..7b5683f6211 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -1,6 +1,6 @@
# 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...
diff --git a/src/tutorial/Makefile b/src/tutorial/Makefile
index 5ddb0ae78c6..19647df6929 100644
--- a/src/tutorial/Makefile
+++ b/src/tutorial/Makefile
@@ -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