mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Consolidate makefile code for setting top_srcdir, srcdir and VPATH.
Responsibility was formerly split between Makefile.global and pgxs.mk. As a result of commit b58233c71b93a32fcab7219585cafc25a27eb769, in the PGXS case, these variables were unset while parsing Makefile.global and callees. Inclusion of Makefile.custom did not work from PGXS, and the subtle difference seemed like a recipe for future bugs. Back-patch to 9.4, where that commit first appeared.
This commit is contained in:
parent
71b66e78e4
commit
c7446194fa
@ -40,9 +40,24 @@ VERSION = @PACKAGE_VERSION@
|
|||||||
MAJORVERSION = @PG_MAJORVERSION@
|
MAJORVERSION = @PG_MAJORVERSION@
|
||||||
VERSION_NUM = @PG_VERSION_NUM@
|
VERSION_NUM = @PG_VERSION_NUM@
|
||||||
|
|
||||||
# Support for VPATH builds
|
# Set top_srcdir, srcdir, and VPATH.
|
||||||
# (PGXS VPATH support is handled separately in pgxs.mk)
|
ifdef PGXS
|
||||||
ifndef PGXS
|
top_srcdir = $(top_builddir)
|
||||||
|
|
||||||
|
# If VPATH is set or Makefile is not in current directory we are building
|
||||||
|
# the extension with VPATH so we set the variable here.
|
||||||
|
ifdef VPATH
|
||||||
|
srcdir = $(VPATH)
|
||||||
|
else
|
||||||
|
ifeq ($(CURDIR),$(dir $(firstword $(MAKEFILE_LIST))))
|
||||||
|
srcdir = .
|
||||||
|
VPATH =
|
||||||
|
else
|
||||||
|
srcdir = $(dir $(firstword $(MAKEFILE_LIST)))
|
||||||
|
VPATH = $(srcdir)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else # not PGXS
|
||||||
vpath_build = @vpath_build@
|
vpath_build = @vpath_build@
|
||||||
abs_top_builddir = @abs_top_builddir@
|
abs_top_builddir = @abs_top_builddir@
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
|
@ -62,21 +62,6 @@ ifdef PGXS
|
|||||||
top_builddir := $(dir $(PGXS))../..
|
top_builddir := $(dir $(PGXS))../..
|
||||||
include $(top_builddir)/src/Makefile.global
|
include $(top_builddir)/src/Makefile.global
|
||||||
|
|
||||||
top_srcdir = $(top_builddir)
|
|
||||||
# If VPATH is set or Makefile is not in current directory we are building
|
|
||||||
# the extension with VPATH so we set the variable here.
|
|
||||||
ifdef VPATH
|
|
||||||
srcdir = $(VPATH)
|
|
||||||
else
|
|
||||||
ifeq ($(CURDIR),$(dir $(firstword $(MAKEFILE_LIST))))
|
|
||||||
srcdir = .
|
|
||||||
VPATH =
|
|
||||||
else
|
|
||||||
srcdir = $(dir $(firstword $(MAKEFILE_LIST)))
|
|
||||||
VPATH = $(srcdir)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# These might be set in Makefile.global, but if they were not found
|
# These might be set in Makefile.global, but if they were not found
|
||||||
# during the build of PostgreSQL, supply default values so that users
|
# during the build of PostgreSQL, supply default values so that users
|
||||||
# of pgxs can use the variables.
|
# of pgxs can use the variables.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user