Skip to content

Commit 6652803

Browse files
author
Timon Karnezos
committed
Changed Makefile to use pg_config on path if not specified by env. Added note in README about how to build with new Makefile. Fixes citusdata#7.
1 parent 29b1e3b commit 6652803

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ endif
3535

3636
SHLIB_LINK += -lstdc++
3737

38-
PG_CONFIG = /usr/pgsql-9.1/bin/pg_config
38+
ifndef PG_CONFIG
39+
PG_CONFIG = pg_config
40+
endif
3941

4042
PGXS := $(shell $(PG_CONFIG) --pgxs)
4143
include $(PGXS)

README.markdown

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,17 @@ If you end up needing to change something to get this running on another system,
359359
Build
360360
=====
361361

362-
## With rpmbuild ##
362+
## With `rpmbuild` ##
363363

364364
Specify versions:
365365

366366
export VER=2.7
367367
export PGSHRT=91
368368

369+
Make sure `Makefile` points to the correct `pg_config` for the specified version, since `rpmbuild` doesn't respect env variables:
370+
371+
PG_CONFIG = /usr/pgsql-9.1/bin/pg_config
372+
369373
Create a tarball from the source tree:
370374

371375
tar cvfz postgresql${PGSHRT}-hll-${VER}.tar.gz postgresql-hll \
@@ -381,16 +385,16 @@ Install RPM:
381385

382386
And if you want the debugging build:
383387

384-
rpm -Uv rpmbuild/RPMS/x86_64/postgresql91-hll-debuginfo-2.7-0.x86_64.rpm
388+
rpm -Uv rpmbuild/RPMS/x86_64/postgresql91-hll-debuginfo-2.7-0.x86_64.rpm
385389

386390

387391
## From source ##
388392

389-
Change `Makefile` to point to correct `pg_config`:
393+
If you aren't using the `pg_config` on your path (or don't have it on your path), specify the correct one to build against:
390394

391-
PG_CONFIG = /usr/pgsql-9.1/bin/pg_config
395+
PG_CONFIG=/usr/pgsql-9.1/bin/pg_config make
392396

393-
Build:
397+
Or to build with what's on your path, just:
394398

395399
make
396400

0 commit comments

Comments
 (0)