$NetBSD: patch-src_backend_Makefile,v 1.1 2024/11/08 13:43:37 adam Exp $

--- src/backend/Makefile.orig	2024-09-23 20:02:53.000000000 +0000
+++ src/backend/Makefile
@@ -16,6 +16,10 @@ subdir = src/backend
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 
+CFLAGS+=	$(DL_CFLAGS)
+LDFLAGS+=	$(DL_LDFLAGS)
+LIBS+=		$(DL_LIBS)
+
 SUBDIRS = access archive backup bootstrap catalog parser commands executor \
 	foreign lib libpq \
 	main nodes optimizer partitioning port postmaster \
@@ -96,6 +100,9 @@ endif # win32
 
 $(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
 
+$(top_builddir)/src/common/libpgcommon_srv.a: | submake-libpgport
+utils: | catalog
+
 
 # The following targets are specified in make commands that appear in
 # the make files in our subdirectories. Note that it's important we
