From 4d4651d2ddd7aeddca11fa4f75f5c5c619b49ec8 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Tue, 4 Jun 2013 09:34:42 -0700 Subject: [PATCH] Restore `?=` for setting PG_CONFIG. And add a note about how it allows an environment variable to be used. --- doc/howto.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/howto.md b/doc/howto.md index b1af993..900ddea 100644 --- a/doc/howto.md +++ b/doc/howto.md @@ -146,7 +146,7 @@ The [`pair`](http://github.com/theory/kv-pair/) and [`semver`](http://github.com REGRESS_OPTS = --inputdir=test DOCS = $(wildcard doc/*.md) # MODULES = $(patsubst %.c,%,$(wildcard src/*.c)) - PG_CONFIG = pg_config + PG_CONFIG ?= pg_config PG91 = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no || echo yes) ifeq ($(PG91),yes) @@ -178,6 +178,10 @@ Next we have the `PG_CONFIG` variable. This points to the [`pg_config`](http://w make PG_CONFIG=/path/to/pg_config +Thanks to the `?=` operator, it can also be set as an environment variable, which is useful for executing multiple `make` commands in a one-liner: + + env PG_CONFIG=/path/to/pg_config make && make installcheck && make install + The `Makefile` next uses `pg_config` to determine whether the extension is being built against PostgreSQL 9.1 or higher. Based on what it finds, extra steps are taken in the following section. That is, if this line returns true: ifeq ($(PG91),yes)