Fix winsock test to properly use cache

This commit is contained in:
Kurt Zeilenga 2009-01-16 23:28:31 +00:00
parent 863754cb82
commit c31eef293f

View File

@ -878,7 +878,7 @@ dnl The following is INTENTIONALLY scripted out because shell does not
dnl support variable names with the '@' character, which is what dnl support variable names with the '@' character, which is what
dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
if test "$ac_cv_header_winsock_h" = yes; then if test "$ac_cv_header_winsock_h" = yes; then
AC_CACHE_CHECK([for winsock], [ol_cv_winsock], AC_CACHE_CHECK([for winsock], [ol_cv_winsock],[
save_LIBS="$LIBS" save_LIBS="$LIBS"
for curlib in ws2_32 wsock32; do for curlib in ws2_32 wsock32; do
LIBS="$LIBS -l$curlib" LIBS="$LIBS -l$curlib"
@ -891,20 +891,25 @@ for curlib in ws2_32 wsock32; do
]])],[ol_cv_winsock=yes],[ol_cv_winsock=no]) ]])],[ol_cv_winsock=yes],[ol_cv_winsock=no])
if test $ol_cv_winsock = yes ; then if test $ol_cv_winsock = yes ; then
if test -a $curlib = ws2_32; then
ol_cv_winsock=winsock2
fi
break
fi
LIBS="$save_LIBS"
done
])
if test $ol_cv_winsock != no ; then
AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock]) AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
ac_cv_func_socket=yes ac_cv_func_socket=yes
ac_cv_func_select=yes ac_cv_func_select=yes
ac_cv_func_closesocket=yes ac_cv_func_closesocket=yes
ac_cv_func_gethostname=yes ac_cv_func_gethostname=yes
if test $curlib = ws2_32; then
ol_cv_winsock=winsock2 if test $ol_cv_winock = winsock2 ; then
AC_DEFINE(HAVE_WINSOCK2, 1, AC_DEFINE(HAVE_WINSOCK2, 1, [define if you have winsock2])
[define if you have winsock2])
fi fi
break
fi
LIBS="$save_LIBS"
done)
fi fi
dnl Find socket() dnl Find socket()