mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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.
This commit is contained 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)
|
||||
|
@ -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...
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user