From e71f21959c37d1f53ab160fa8b3b49c4542e68e2 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 16 Jan 2009 23:45:24 +0000 Subject: [PATCH] Another winsock2 fix attempt --- configure | 21 ++++++++++++--------- configure.in | 23 +++++++++++++---------- 2 files changed, 25 insertions(+), 19 deletions(-) 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 -- 2.39.5