Patch-Source: https://src.fedoraproject.org/rpms/postgresql/blob/f35/f/postgresql-external-libpq.patch

This patch is applied only when building non-default postgresql aport, i.e.
we want to link against libpq provided by the default postgresql aport.

diff --git a/src/Makefile b/src/Makefile
index bcdbd95..4bea236 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -20,7 +20,6 @@ SUBDIRS = \
 	backend/utils/mb/conversion_procs \
 	backend/snowball \
 	include \
-	interfaces \
 	backend/replication/libpqwalreceiver \
 	backend/replication/pgoutput \
 	fe_utils \
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index b9d86ac..29df69f 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -585,7 +585,7 @@ endif
 # How to link to libpq.  (This macro may be used as-is by backend extensions.
 # Client-side code should go through libpq_pgport or libpq_pgport_shlib,
 # instead.)
-libpq = -L$(libpq_builddir) -lpq
+libpq = -lpq
 
 # libpq_pgport is for use by client executables (not libraries) that use libpq.
 # We used to use this to force libpgport and libpgcommon to be linked before
@@ -623,7 +623,6 @@ endif
 # Commonly used submake targets
 
 submake-libpq: | submake-generated-headers
-	$(MAKE) -C $(libpq_builddir) all
 
 submake-libpgport: | submake-generated-headers
 	$(MAKE) -C $(top_builddir)/src/port all
-- 
2.21.0

