Fix PGXS vpath build when PostgreSQL is built with vpath
authorPeter Eisentraut
Thu, 4 Dec 2014 22:02:02 +0000 (17:02 -0500)
committerPeter Eisentraut
Thu, 4 Dec 2014 22:03:37 +0000 (17:03 -0500)
PGXS computes srcdir from VPATH, PostgreSQL proper computes VPATH from
srcdir, and doing both results in an error from make.  Conditionalize so
only one of these takes effect.

src/Makefile.global.in

index d7a83c89a2d08dd7ea181ebb5b509c3f20e3cfaa..377812ba1ae2ceb42a80c947664e5faac6738cdb 100644 (file)
@@ -40,6 +40,8 @@ VERSION = @PACKAGE_VERSION@
 MAJORVERSION = @PG_MAJORVERSION@
 
 # Support for VPATH builds
+# (PGXS VPATH support is handled separately in pgxs.mk)
+ifndef PGXS
 vpath_build = @vpath_build@
 abs_top_srcdir = @abs_top_srcdir@
 
@@ -51,6 +53,7 @@ top_srcdir = $(abs_top_srcdir)
 srcdir = $(top_srcdir)/$(subdir)
 VPATH = $(srcdir)
 endif
+endif # not PGXS
 
 vpathsearch = `for f in $(addsuffix /$(1),$(subst :, ,. $(VPATH))); do test -r $$f && echo $$f && break; done`