Skip to content

Commit

Permalink
Restore ?= for setting PG_CONFIG.
Browse files Browse the repository at this point in the history
And add a note about how it allows an environment variable to be used.
  • Loading branch information
theory committed Jun 4, 2013
1 parent 0d582d9 commit 4d4651d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4d4651d

Please sign in to comment.