summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2014-10-21 22:55:43 -0400
committerNoah Misch <noah@leadboat.com>2014-10-21 22:56:28 -0400
commit9e02e20ab6df093e1ab751157dfb5c51a420187b (patch)
tree8fe6006b2fe6f3d63cce52ed49393bb1930a7e53 /src
parent7a14edb83e1c5c3c683cf0c8a90870e3bda9d22c (diff)
MinGW: Link with shell32.dll instead of shfolder.dll.
This improves consistency with the MSVC build. On buildfarm member narwhal, since commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027, shfolder.dll:SHGetFolderPath() crashes when dblink calls it by way of pqGetHomeDirectory(). Back-patch to 9.4, where that commit first appeared. How it caused this regression remains a mystery. This is a partial revert of commit 889f03812916b146ae504c0fad5afdc7bf2e8a2a, which adopted shfolder.dll for Windows NT 4.0 compatibility. PostgreSQL 8.2 dropped support for that operating system.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in5
-rw-r--r--src/interfaces/ecpg/ecpglib/Makefile5
-rw-r--r--src/interfaces/libpq/Makefile2
-rw-r--r--src/interfaces/libpq/win32.mak2
-rw-r--r--src/port/path.c8
5 files changed, 9 insertions, 13 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 7b6ccd5f9cb..d347322233b 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -547,10 +547,9 @@ LIBOBJS = @LIBOBJS@
LIBS := -lpgcommon -lpgport $(LIBS)
-# to make ws2_32.lib the last library, and always link with shfolder,
-# so SHGetFolderName isn't picked up from shell32.dll
+# to make ws2_32.lib the last library
ifeq ($(PORTNAME),win32)
-LIBS += -lws2_32 -lshfolder
+LIBS += -lws2_32
endif
# Not really standard libc functions, used by the backend.
diff --git a/src/interfaces/ecpg/ecpglib/Makefile b/src/interfaces/ecpg/ecpglib/Makefile
index ae4474f9884..e65fea93452 100644
--- a/src/interfaces/ecpg/ecpglib/Makefile
+++ b/src/interfaces/ecpg/ecpglib/Makefile
@@ -38,11 +38,6 @@ SHLIB_PREREQS = submake-libpq submake-pgtypeslib
SHLIB_EXPORTS = exports.txt
-ifeq ($(PORTNAME), win32)
-# Link to shfolder.dll instead of shell32.dll
-SHLIB_LINK += -lshfolder
-endif
-
PKG_CONFIG_REQUIRES_PRIVATE = libpq libpgtypes
all: all-lib
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index c794b9647c6..7fea34369fc 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -70,7 +70,7 @@ else
SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lgssapi32 -lssl -lsocket -lnsl -lresolv -lintl $(PTHREAD_LIBS), $(LIBS)) $(LDAP_LIBS_FE)
endif
ifeq ($(PORTNAME), win32)
-SHLIB_LINK += -lshfolder -lwsock32 -lws2_32 -lsecur32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS))
+SHLIB_LINK += -lshell32 -lwsock32 -lws2_32 -lsecur32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS))
endif
SHLIB_EXPORTS = exports.txt
diff --git a/src/interfaces/libpq/win32.mak b/src/interfaces/libpq/win32.mak
index 23e09e98100..4e4a60e9b8b 100644
--- a/src/interfaces/libpq/win32.mak
+++ b/src/interfaces/libpq/win32.mak
@@ -208,7 +208,7 @@ CPP_SBRS=.
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res"
LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shfolder.lib wsock32.lib ws2_32.lib secur32.lib $(SSL_LIBS) $(KFW_LIB) $(ADD_SECLIB) \
+LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shell32.lib wsock32.lib ws2_32.lib secur32.lib $(SSL_LIBS) $(KFW_LIB) $(ADD_SECLIB) \
/nologo /subsystem:windows /dll $(LOPT) /incremental:no \
/pdb:"$(OUTDIR)\libpqdll.pdb" /machine:$(CPU) \
/out:"$(OUTDIR)\$(OUTFILENAME).dll"\
diff --git a/src/port/path.c b/src/port/path.c
index 378920597d0..4f2b152fdc9 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -785,9 +785,11 @@ get_home_path(char *ret_path)
char *tmppath;
/*
- * Note: We use getenv here because the more modern
- * SHGetSpecialFolderPath() will force us to link with shell32.lib which
- * eats valuable desktop heap.
+ * Note: We use getenv() here because the more modern SHGetFolderPath()
+ * would force the backend to link with shell32.lib, which eats valuable
+ * desktop heap. XXX This function is used only in psql, which already
+ * brings in shell32 via libpq. Moving this function to its own file
+ * would keep it out of the backend, freeing it from this concern.
*/
tmppath = getenv("APPDATA");
if (!tmppath)