Skip to content

Commit

Permalink
configure: hoist defaulting of PG_CONFIG var to top of script
Browse files Browse the repository at this point in the history
  • Loading branch information
whitslack committed Aug 29, 2020
1 parent ace8fc2 commit a29632d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ CONFIG_VAR_FILE=config.vars
CONFIG_HEADER=ccan/config.h
BASE_WARNFLAGS="-Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -Werror"

# You can set PG_CONFIG in the environment to direct configure to call
# a specific 'pg_config' binary. If you set it to an empty string, then
# PostgreSQL support will be explicitly disabled, even if a 'pg_config'
# binary exists in your PATH. If you leave it unset, then the following
# line enables the automagic detection that most users want.
: ${PG_CONFIG=pg_config}

usage_with_default()
{
if [ $# = 4 ]; then
Expand Down Expand Up @@ -231,9 +238,9 @@ require 'python3-mako' "You need the mako module for python3: see doc/INSTALL.md

POSTGRES_INCLUDE=""
POSTGRES_LDLIBS=""
if command -v "${PG_CONFIG-pg_config}" >/dev/null; then
POSTGRES_INCLUDE="-I$("${PG_CONFIG-pg_config}" --includedir)"
POSTGRES_LDLIBS="-L$("${PG_CONFIG-pg_config}" --libdir) -lpq"
if command -v "${PG_CONFIG}" >/dev/null; then
POSTGRES_INCLUDE="-I$("${PG_CONFIG}" --includedir)"
POSTGRES_LDLIBS="-L$("${PG_CONFIG}" --libdir) -lpq"
fi

rm -f $CONFIG_VAR_FILE.$$
Expand Down

0 comments on commit a29632d

Please sign in to comment.