Skip to content

Commit 1e95bbc

Browse files
committed
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 6697aa2 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.
1 parent e86507d commit 1e95bbc

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

contrib/dblink/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ MODULE_big = dblink
44
OBJS = dblink.o $(WIN32RES)
55
PG_CPPFLAGS = -I$(libpq_srcdir)
66
SHLIB_LINK = $(libpq)
7-
SHLIB_PREREQS = submake-libpq
87

98
EXTENSION = dblink
109
DATA = dblink--1.1.sql dblink--1.0--1.1.sql dblink--unpackaged--1.0.sql
@@ -19,6 +18,7 @@ PG_CONFIG = pg_config
1918
PGXS := $(shell $(PG_CONFIG) --pgxs)
2019
include $(PGXS)
2120
else
21+
SHLIB_PREREQS = submake-libpq
2222
subdir = contrib/dblink
2323
top_builddir = ../..
2424
include $(top_builddir)/src/Makefile.global

contrib/postgres_fdw/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ PGFILEDESC = "postgres_fdw - foreign data wrapper for PostgreSQL"
66

77
PG_CPPFLAGS = -I$(libpq_srcdir)
88
SHLIB_LINK = $(libpq)
9-
SHLIB_PREREQS = submake-libpq
109

1110
EXTENSION = postgres_fdw
1211
DATA = postgres_fdw--1.0.sql
@@ -18,6 +17,7 @@ PG_CONFIG = pg_config
1817
PGXS := $(shell $(PG_CONFIG) --pgxs)
1918
include $(PGXS)
2019
else
20+
SHLIB_PREREQS = submake-libpq
2121
subdir = contrib/postgres_fdw
2222
top_builddir = ../..
2323
include $(top_builddir)/src/Makefile.global

src/Makefile.global.in

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -458,23 +458,13 @@ ifeq ($(PORTNAME),cygwin)
458458
libpq_pgport += $(LDAP_LIBS_FE)
459459
endif
460460

461-
# If PGXS is not defined, build libpq and libpgport dependencies as required.
462-
# If the build is with PGXS, then these are supposed to be already built and
463-
# installed, and we just ensure that the expected files exist.
464-
ifndef PGXS
461+
465462
submake-libpq:
466463
$(MAKE) -C $(libpq_builddir) all
467-
else
468-
submake-libpq: $(libdir)/libpq.so ;
469-
endif
470464

471-
ifndef PGXS
472465
submake-libpgport:
473466
$(MAKE) -C $(top_builddir)/src/port all
474467
$(MAKE) -C $(top_builddir)/src/common all
475-
else
476-
submake-libpgport: $(libdir)/libpgport.a $(libdir)/libpgcommon.a ;
477-
endif
478468

479469
.PHONY: submake-libpq submake-libpgport
480470

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy