]> granicus.if.org Git - postgresql/commitdiff
Remove dependency on wsock32.lib in favor of ws2_32
authorMagnus Hagander <magnus@hagander.net>
Tue, 15 Jul 2014 12:18:39 +0000 (14:18 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 15 Jul 2014 12:18:39 +0000 (14:18 +0200)
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

configure
configure.in
contrib/pgcrypto/Makefile
src/interfaces/libpq/Makefile
src/interfaces/libpq/win32.c
src/interfaces/libpq/win32.mak
src/test/thread/README
src/tools/msvc/Mkvcbuild.pm

index 481096ca8948eab58e237067b4b3f9d6e59a4085..75979166efe84d88312bda4366cfeb43c1b9bfa1 100755 (executable)
--- 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
index c938a5d6c606f8572e9a94f47a5b297937c30cc1..9d1f1187645ca2b872a2cd394e5bd1cc0b5e5873 100644 (file)
@@ -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
index 05716c99fe39862dab9fae43bc74ce031b17c461..b6c94844b2ce4b79192cc5abae3016b277f2a6b5 100644 (file)
@@ -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
index 15ea648291712c513acff82966f4430ac5bb130e..718ecd686c48265aced3a6e40b8344d3b92abced 100644 (file)
@@ -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
index 88d12d61057542b059354a420a4b40025e51bf86..c0fe0fb99d59863121d1508a3d6a2ad139e75c84 100644 (file)
@@ -247,9 +247,6 @@ struct MessageDLL
        {
                "winsock.dll", 0, 0
        },
-       {
-               "wsock32.dll", 0, 0
-       },
        {
                "ws2_32.dll", 0, 0
        },
index 23e09e981006bf11127d58910a92953814ae3deb..99fef27375b48b9e77e35443693ac7652afb6114 100644 (file)
@@ -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"\
index 00ec2fff06f763e8b88bec9e214a80c827d122d3..4da23440f6b539b4628d41e726195c48b8fc5e57 100644 (file)
@@ -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:
index 19580031f4f316c28fbc516529370bcd8396c65b..b71da67f5bef92281a99a164b5829c65fe33830d 100644 (file)
@@ -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);