Commit 1e95bbc8 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix SHLIB_PREREQS use in contrib, allowing PGXS builds

dblink and postgres_fdw use SHLIB_PREREQS = submake-libpq to build libpq
first.  This doesn't work in a PGXS build, because there is no libpq to
build.  So just omit setting SHLIB_PREREQS in this case.

Note that PGXS users can still use SHLIB_PREREQS (although it is not
documented).  The problem here is only that contrib modules can be built
in-tree or using PGXS, and the prerequisite is only applicable in the
former case.

Commit 6697aa2b previously attempted to
address this by creating a somewhat fake submake-libpq target in
Makefile.global.  That was not the right fix, and it was also done in a
nonportable way, so revert that.
parent e86507d7
...@@ -4,7 +4,6 @@ MODULE_big = dblink ...@@ -4,7 +4,6 @@ MODULE_big = dblink
OBJS = dblink.o $(WIN32RES) OBJS = dblink.o $(WIN32RES)
PG_CPPFLAGS = -I$(libpq_srcdir) PG_CPPFLAGS = -I$(libpq_srcdir)
SHLIB_LINK = $(libpq) SHLIB_LINK = $(libpq)
SHLIB_PREREQS = submake-libpq
EXTENSION = dblink EXTENSION = dblink
DATA = dblink--1.1.sql dblink--1.0--1.1.sql dblink--unpackaged--1.0.sql DATA = dblink--1.1.sql dblink--1.0--1.1.sql dblink--unpackaged--1.0.sql
...@@ -19,6 +18,7 @@ PG_CONFIG = pg_config ...@@ -19,6 +18,7 @@ PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs) PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
SHLIB_PREREQS = submake-libpq
subdir = contrib/dblink subdir = contrib/dblink
top_builddir = ../.. top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
......
...@@ -6,7 +6,6 @@ PGFILEDESC = "postgres_fdw - foreign data wrapper for PostgreSQL" ...@@ -6,7 +6,6 @@ PGFILEDESC = "postgres_fdw - foreign data wrapper for PostgreSQL"
PG_CPPFLAGS = -I$(libpq_srcdir) PG_CPPFLAGS = -I$(libpq_srcdir)
SHLIB_LINK = $(libpq) SHLIB_LINK = $(libpq)
SHLIB_PREREQS = submake-libpq
EXTENSION = postgres_fdw EXTENSION = postgres_fdw
DATA = postgres_fdw--1.0.sql DATA = postgres_fdw--1.0.sql
...@@ -18,6 +17,7 @@ PG_CONFIG = pg_config ...@@ -18,6 +17,7 @@ PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs) PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS) include $(PGXS)
else else
SHLIB_PREREQS = submake-libpq
subdir = contrib/postgres_fdw subdir = contrib/postgres_fdw
top_builddir = ../.. top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
......
...@@ -458,23 +458,13 @@ ifeq ($(PORTNAME),cygwin) ...@@ -458,23 +458,13 @@ ifeq ($(PORTNAME),cygwin)
libpq_pgport += $(LDAP_LIBS_FE) libpq_pgport += $(LDAP_LIBS_FE)
endif endif
# If PGXS is not defined, build libpq and libpgport dependencies as required.
# If the build is with PGXS, then these are supposed to be already built and
# installed, and we just ensure that the expected files exist.
ifndef PGXS
submake-libpq: submake-libpq:
$(MAKE) -C $(libpq_builddir) all $(MAKE) -C $(libpq_builddir) all
else
submake-libpq: $(libdir)/libpq.so ;
endif
ifndef PGXS
submake-libpgport: submake-libpgport:
$(MAKE) -C $(top_builddir)/src/port all $(MAKE) -C $(top_builddir)/src/port all
$(MAKE) -C $(top_builddir)/src/common all $(MAKE) -C $(top_builddir)/src/common all
else
submake-libpgport: $(libdir)/libpgport.a $(libdir)/libpgcommon.a ;
endif
.PHONY: submake-libpq submake-libpgport .PHONY: submake-libpq submake-libpgport
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment