Check for -lws2_32 properly. The old code relied on $host_os, which

wasn't defined.
This commit is contained in:
Markus Armbruster 2006-03-04 06:55:12 +00:00
parent 3c5e8a0b46
commit 0605e10c50

View file

@ -49,14 +49,20 @@ AC_PROG_INSTALL
### Checks for libraries. ### Checks for libraries.
LIB_SOCKET_NSL
AC_SEARCH_LIBS([setupterm], [termlib termcap]) AC_SEARCH_LIBS([setupterm], [termlib termcap])
LIB_SOCKET_NSL
# TODO merge this into LIB_SOCKET_NSL? # TODO merge this into LIB_SOCKET_NSL?
case "$host_os" in if test "$ac_cv_search_gethostbyname" = no; then
*mingw32) dnl Can't search ws2_32 for gethostbyname using AC_SEARCH_LIBS, because
LIBS="-lws2_32 $LIBS" ;; dnl it requires #include <winsocks2.h> to work.
esac AC_MSG_CHECKING([for gethostbyname in -lws2_32])
save_LIBS=$LIBS
LIBS="-lws2_32 $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]],
[[gethostbyname ("");]])],
[ws2_res=yes], [LIBS=save_LIBS ws2_res=no])
AC_MSG_RESULT([$ws2_res])
fi
### Checks for header files. ### Checks for header files.