]> git.sur5r.net Git - openldap/commitdiff
Another winsock2 fix attempt
authorKurt Zeilenga <kurt@openldap.org>
Fri, 16 Jan 2009 23:45:24 +0000 (23:45 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 16 Jan 2009 23:45:24 +0000 (23:45 +0000)
configure
configure.in

index 8b4a124aa992847f3630d067d9a1e3b100052ca4..c11bef69b1a6adae05f042c3a88d5c1def70c50a 100755 (executable)
--- a/configure
+++ b/configure
@@ -15295,8 +15295,10 @@ if test "${ol_cv_winsock+set}" = set; then
 else
 
 save_LIBS="$LIBS"
-for curlib in ws2_32 wsock32; do
-       LIBS="$LIBS -l$curlib"
+for curlib in none ws2_32 wsock32; do
+       if test curlib != none ; then
+           LIBS="$save_LIBS -l$curlib"
+       fi
        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15348,14 +15350,11 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
        if test $ol_cv_winsock = yes ; then
-               if test -a $curlib = ws2_32; then
-                       ol_cv_winsock=winsock2
-               fi
-               break
+           ol_cv_winsock=$curlib
        fi
-
-       LIBS="$save_LIBS"
+       break
 done
+LIBS="$save_LIBS"
 
 fi
 { echo "$as_me:$LINENO: result: $ol_cv_winsock" >&5
@@ -15371,7 +15370,11 @@ _ACEOF
     ac_cv_func_closesocket=yes
     ac_cv_func_gethostname=yes
 
-    if test $ol_cv_winock = winsock2 ; then
+       if test $ol_cv_winsock != none ; then
+        LIBS="$LIBS -l$ol_cv_winsock"
+       fi
+
+    if test $ol_cv_winsock = ws2_32 ; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_WINSOCK2 1
index 779593b110ce15e39d39594b3c888281d2016b56..1b4b8f65dee567806bf32547eb4dfcc494d00688 100644 (file)
@@ -880,8 +880,10 @@ dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
 if test "$ac_cv_header_winsock_h" = yes; then
 AC_CACHE_CHECK([for winsock], [ol_cv_winsock],[
 save_LIBS="$LIBS"
-for curlib in ws2_32 wsock32; do
-       LIBS="$LIBS -l$curlib"
+for curlib in none ws2_32 wsock32; do
+       if test curlib != none ; then
+           LIBS="$save_LIBS -l$curlib"
+       fi
        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>
                        ]], [[
                        socket(0,0,0);
@@ -891,14 +893,11 @@ for curlib in ws2_32 wsock32; do
                        ]])],[ol_cv_winsock=yes],[ol_cv_winsock=no])
 
        if test $ol_cv_winsock = yes ; then
-               if test -a $curlib = ws2_32; then
-                       ol_cv_winsock=winsock2
-               fi
-               break
+           ol_cv_winsock=$curlib
        fi
-
-       LIBS="$save_LIBS"
+       break
 done
+LIBS="$save_LIBS"
 ])
 if test $ol_cv_winsock != no ; then
     AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
@@ -907,8 +906,12 @@ if test $ol_cv_winsock != no ; then
     ac_cv_func_closesocket=yes
     ac_cv_func_gethostname=yes
 
-    if test $ol_cv_winock = winsock2 ; then
-       AC_DEFINE(HAVE_WINSOCK2, 1, [define if you have winsock2])
+       if test $ol_cv_winsock != none ; then
+        LIBS="$LIBS -l$ol_cv_winsock"
+       fi
+
+    if test $ol_cv_winsock = ws2_32 ; then
+               AC_DEFINE(HAVE_WINSOCK2, 1, [define if you have winsock2])
     fi
 fi