From: Kurt Zeilenga Date: Fri, 16 Jan 2009 23:45:24 +0000 (+0000) Subject: Another winsock2 fix attempt X-Git-Tag: ACLCHECK_0~999 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e71f21959c37d1f53ab160fa8b3b49c4542e68e2;p=openldap Another winsock2 fix attempt --- diff --git a/configure b/configure index 8b4a124aa9..c11bef69b1 100755 --- 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 diff --git a/configure.in b/configure.in index 779593b110..1b4b8f65de 100644 --- a/configure.in +++ b/configure.in @@ -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 ]], [[ 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