aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2014-07-15 14:18:39 +0200
committerMagnus Hagander <magnus@hagander.net>2014-07-15 14:18:39 +0200
commita16bac36eca8158cbf78987e95376f610095f792 (patch)
tree560cb781a3234f68aacb6812c82c0eafc912d2f1
parentf162fb75b329bc5370b3ece59f5ef0d5ba0f15d6 (diff)
downloadpostgresql-a16bac36eca8158cbf78987e95376f610095f792.tar.gz
postgresql-a16bac36eca8158cbf78987e95376f610095f792.zip
Remove dependency on wsock32.lib in favor of ws2_32
ws2_32 is the new version of the library that should be used, as it contains the require functionality from wsock32 as well as some more (which is why some binaries were already using ws2_32). Michael Paquier, reviewed by MauMau
-rwxr-xr-xconfigure2
-rw-r--r--configure.in2
-rw-r--r--contrib/pgcrypto/Makefile2
-rw-r--r--src/interfaces/libpq/Makefile2
-rw-r--r--src/interfaces/libpq/win32.c3
-rw-r--r--src/interfaces/libpq/win32.mak2
-rw-r--r--src/test/thread/README2
-rw-r--r--src/tools/msvc/Mkvcbuild.pm13
8 files changed, 11 insertions, 17 deletions
diff --git a/configure b/configure
index 481096ca894..75979166efe 100755
--- a/configure
+++ b/configure
@@ -7659,7 +7659,7 @@ return socket ();
return 0;
}
_ACEOF
-for ac_lib in '' socket wsock32; do
+for ac_lib in '' socket ws2_32; do
if test -z "$ac_lib"; then
ac_res="none required"
else
diff --git a/configure.in b/configure.in
index c938a5d6c60..9d1f1187645 100644
--- a/configure.in
+++ b/configure.in
@@ -891,7 +891,7 @@ fi
AC_CHECK_LIB(m, main)
AC_SEARCH_LIBS(setproctitle, util)
AC_SEARCH_LIBS(dlopen, dl)
-AC_SEARCH_LIBS(socket, [socket wsock32])
+AC_SEARCH_LIBS(socket, [socket ws2_32])
AC_SEARCH_LIBS(shl_load, dld)
# We only use libld in port/dynloader/aix.c
case $host_os in
diff --git a/contrib/pgcrypto/Makefile b/contrib/pgcrypto/Makefile
index 05716c99fe3..b6c94844b2c 100644
--- a/contrib/pgcrypto/Makefile
+++ b/contrib/pgcrypto/Makefile
@@ -55,7 +55,7 @@ SHLIB_LINK += $(filter -lcrypto -lz, $(LIBS))
ifeq ($(PORTNAME), win32)
SHLIB_LINK += $(filter -leay32, $(LIBS))
# those must be at the end
-SHLIB_LINK += -lwsock32 -lws2_32
+SHLIB_LINK += -lws2_32
endif
rijndael.o: rijndael.tbl
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 15ea6482917..718ecd686c4 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 += -lshfolder -lws2_32 -lsecur32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS))
endif
SHLIB_EXPORTS = exports.txt
diff --git a/src/interfaces/libpq/win32.c b/src/interfaces/libpq/win32.c
index 88d12d61057..c0fe0fb99d5 100644
--- a/src/interfaces/libpq/win32.c
+++ b/src/interfaces/libpq/win32.c
@@ -248,9 +248,6 @@ struct MessageDLL
"winsock.dll", 0, 0
},
{
- "wsock32.dll", 0, 0
- },
- {
"ws2_32.dll", 0, 0
},
{
diff --git a/src/interfaces/libpq/win32.mak b/src/interfaces/libpq/win32.mak
index 23e09e98100..99fef27375b 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 shfolder.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/test/thread/README b/src/test/thread/README
index 00ec2fff06f..4da23440f6b 100644
--- a/src/test/thread/README
+++ b/src/test/thread/README
@@ -40,7 +40,7 @@ to test your system however, you can do so as follows:
-D_POSIX_PTHREAD_SEMANTICS \
-I../../../src/include/port/win32 \
thread_test.c \
- -lwsock32 \
+ -lws2_32 \
-lpthreadgc2
3) Run thread_test.exe. You should see output like:
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 19580031f4f..b71da67f5be 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -44,7 +44,7 @@ my @contrib_uselibpgcommon = (
'pg_test_fsync', 'pg_test_timing',
'pg_upgrade', 'pg_xlogdump',
'vacuumlo');
-my $contrib_extralibs = { 'pgbench' => ['wsock32.lib'] };
+my $contrib_extralibs = { 'pgbench' => ['ws2_32.lib'] };
my $contrib_extraincludes =
{ 'tsearch2' => ['contrib/tsearch2'], 'dblink' => ['src/backend'] };
my $contrib_extrasource = {
@@ -113,9 +113,8 @@ sub mkvcbuild
$postgres->AddFiles('src\backend\replication', 'repl_scanner.l',
'repl_gram.y');
$postgres->AddDefine('BUILDING_DLL');
- $postgres->AddLibrary('wsock32.lib');
- $postgres->AddLibrary('ws2_32.lib');
$postgres->AddLibrary('secur32.lib');
+ $postgres->AddLibrary('ws2_32.lib');
$postgres->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap});
$postgres->FullExportDLL('postgres.lib');
@@ -270,7 +269,6 @@ sub mkvcbuild
$libpq->AddDefine('FRONTEND');
$libpq->AddDefine('UNSAFE_STAT_OK');
$libpq->AddIncludeDir('src\port');
- $libpq->AddLibrary('wsock32.lib');
$libpq->AddLibrary('secur32.lib');
$libpq->AddLibrary('ws2_32.lib');
$libpq->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap});
@@ -300,7 +298,7 @@ sub mkvcbuild
$libecpg->AddIncludeDir('src\interfaces\libpq');
$libecpg->AddIncludeDir('src\port');
$libecpg->UseDef('src\interfaces\ecpg\ecpglib\ecpglib.def');
- $libecpg->AddLibrary('wsock32.lib');
+ $libecpg->AddLibrary('ws2_32.lib');
$libecpg->AddReference($libpq, $pgtypes, $libpgport);
my $libecpgcompat = $solution->AddProject(
@@ -345,7 +343,7 @@ sub mkvcbuild
$isolation_tester->AddIncludeDir('src\interfaces\libpq');
$isolation_tester->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
$isolation_tester->AddDefine('FRONTEND');
- $isolation_tester->AddLibrary('wsock32.lib');
+ $isolation_tester->AddLibrary('ws2_32.lib');
$isolation_tester->AddReference($libpq, $libpgcommon, $libpgport);
my $pgregress_isolation =
@@ -363,7 +361,6 @@ sub mkvcbuild
$initdb->AddIncludeDir('src\interfaces\libpq');
$initdb->AddIncludeDir('src\timezone');
$initdb->AddDefine('FRONTEND');
- $initdb->AddLibrary('wsock32.lib');
$initdb->AddLibrary('ws2_32.lib');
my $pgbasebackup = AddSimpleFrontend('pg_basebackup', 1);
@@ -507,7 +504,7 @@ sub mkvcbuild
'pgp-mpi-internal.c', 'imath.c');
}
$pgcrypto->AddReference($postgres);
- $pgcrypto->AddLibrary('wsock32.lib');
+ $pgcrypto->AddLibrary('ws2_32.lib');
my $mf = Project::read_file('contrib/pgcrypto/Makefile');
GenerateContribSqlFiles('pgcrypto', $mf);