summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2017-07-05 19:23:22 +0000
committerTom Lane2017-07-05 19:23:22 +0000
commitff68e909acd924b532e58c7699e93a1aff71654a (patch)
treed9200e6d05d6356618cde42b76772c28dadf0d3f
parent6deb52b202e0f673b583b03ad141ccad6f8e7fba (diff)
Restore linking libpq into pg_ctl on Mingw builds.
Commit 1ae853654 missed this. Per Andrew Dunstan.
-rw-r--r--src/bin/pg_ctl/Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/pg_ctl/Makefile b/src/bin/pg_ctl/Makefile
index 46f30bd46f..03ae8dea76 100644
--- a/src/bin/pg_ctl/Makefile
+++ b/src/bin/pg_ctl/Makefile
@@ -16,12 +16,20 @@ subdir = src/bin/pg_ctl
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
+# On Windows, we need to link with libpq, just for use of pqexpbuffer;
+# but let's not pull that in on platforms where we don't need it.
+ifeq ($(PORTNAME), win32)
+override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
+SUBMAKE_LIBPQ := submake-libpq
+LIBPQ_PGPORT := $(libpq_pgport)
+endif
+
OBJS= pg_ctl.o $(WIN32RES)
all: pg_ctl
-pg_ctl: $(OBJS) | submake-libpgport
- $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
+pg_ctl: $(OBJS) | submake-libpgport $(SUBMAKE_LIBPQ)
+ $(CC) $(CFLAGS) $(OBJS) $(LIBPQ_PGPORT) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs
$(INSTALL_PROGRAM) pg_ctl$(X) '$(DESTDIR)$(bindir)/pg_ctl$(X)'