Skip to content

Commit 6e96d4d

Browse files
committed
Copy the libpq DLL to the bin directory on Mingw and Cygwin.
This has long been done by the MSVC build system, and has caused confusion in the past when programs like psql have failed to start because they can't find the DLL. If it's in the same directory as it now will be they will find it. Backpatch to all live branches.
1 parent ebe3344 commit 6e96d4d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/interfaces/libpq/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,28 @@ install: all installdirs install-lib
120120
$(INSTALL_DATA) $(srcdir)/libpq-int.h '$(DESTDIR)$(includedir_internal)'
121121
$(INSTALL_DATA) $(srcdir)/pqexpbuffer.h '$(DESTDIR)$(includedir_internal)'
122122
$(INSTALL_DATA) $(srcdir)/pg_service.conf.sample '$(DESTDIR)$(datadir)/pg_service.conf.sample'
123+
ifneq (,$findstring($(PORTNAME), win32 cygwin))
124+
$(INSTALL_DATA) $(shlib) '$(DESTDIR)$(bindir)/$(shlib)'
125+
endif
123126

124127
installcheck:
125128
$(MAKE) -C test $@
126129

127130
installdirs: installdirs-lib
128131
$(MKDIR_P) '$(DESTDIR)$(includedir)' '$(DESTDIR)$(includedir_internal)'
132+
ifneq (,$findstring($(PORTNAME), win32 cygwin))
133+
$(MKDIR_P) '$(DESTDIR)$(bindir)'
134+
endif
129135

130136
uninstall: uninstall-lib
131137
rm -f '$(DESTDIR)$(includedir)/libpq-fe.h'
132138
rm -f '$(DESTDIR)$(includedir)/libpq-events.h'
133139
rm -f '$(DESTDIR)$(includedir_internal)/libpq-int.h'
134140
rm -f '$(DESTDIR)$(includedir_internal)/pqexpbuffer.h'
135141
rm -f '$(DESTDIR)$(datadir)/pg_service.conf.sample'
142+
ifneq (,$findstring($(PORTNAME), win32 cygwin))
143+
rm -f '$(DESTDIR)$(bindir)/$(shlib)'
144+
endif
136145

137146
clean distclean: clean-lib
138147
$(MAKE) -C test $@

0 commit comments

Comments
 (0)