]> granicus.if.org Git - postgresql/commitdiff
Fix SHLIB_PREREQS use in contrib, allowing PGXS builds
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 4 Dec 2014 12:58:12 +0000 (07:58 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 4 Dec 2014 13:45:38 +0000 (08:45 -0500)
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 6697aa2bc25c83b88d6165340348a31328c35de6 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.

contrib/dblink/Makefile
contrib/postgres_fdw/Makefile
src/Makefile.global.in

index 09032f89702a4aee07fa819d2fb15f83de72ab34..7cb023705ad500dedb5a4b7f9dfcc2d9e2f7ce2f 100644 (file)
@@ -4,7 +4,6 @@ MODULE_big = dblink
 OBJS   = dblink.o
 PG_CPPFLAGS = -I$(libpq_srcdir)
 SHLIB_LINK = $(libpq)
-SHLIB_PREREQS = submake-libpq
 
 EXTENSION = dblink
 DATA = dblink--1.1.sql dblink--1.0--1.1.sql dblink--unpackaged--1.0.sql
@@ -21,6 +20,7 @@ PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
+SHLIB_PREREQS = submake-libpq
 subdir = contrib/dblink
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
index 8c497201d0e7705e39fc0028cf62d8a771dc659c..c0f4160f6ba40d266b6cfe3c3a601b0a6f88f46d 100644 (file)
@@ -5,7 +5,6 @@ OBJS = postgres_fdw.o option.o deparse.o connection.o
 
 PG_CPPFLAGS = -I$(libpq_srcdir)
 SHLIB_LINK = $(libpq)
-SHLIB_PREREQS = submake-libpq
 
 EXTENSION = postgres_fdw
 DATA = postgres_fdw--1.0.sql
@@ -20,6 +19,7 @@ PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
+SHLIB_PREREQS = submake-libpq
 subdir = contrib/postgres_fdw
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
index aa54f94763e001762164d85e8ba41bcd061dfdea..d7a83c89a2d08dd7ea181ebb5b509c3f20e3cfaa 100644 (file)
@@ -456,23 +456,13 @@ ifeq ($(PORTNAME),cygwin)
 libpq_pgport += $(LDAP_LIBS_FE)
 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:
        $(MAKE) -C $(libpq_builddir) all
-else
-submake-libpq: $(libdir)/libpq.so ;
-endif
 
-ifndef PGXS
 submake-libpgport:
        $(MAKE) -C $(top_builddir)/src/port all
        $(MAKE) -C $(top_builddir)/src/common all
-else
-submake-libpgport: $(libdir)/libpgport.a $(libdir)/libpgcommon.a ;
-endif
 
 .PHONY: submake-libpq submake-libpgport