--- curl-7.11.1-20040205/configure.ac Wed Feb 4 03:00:18 2004 +++ curl-7.11.1-new/configure.ac Fri Feb 6 10:16:00 2004 @@ -220,9 +220,23 @@ AC_CHECK_FUNC(gethostbyname, , [ AC_CHECK_LIB(socket, gethostbyname) ]) fi +dnl This is for Msys/Mingw +AC_MSG_CHECKING([for gethostbyname in ws2_32]) +my_ac_save_LIBS=$LIBS +LIBS="-lws2_32 $LIBS" +AC_TRY_LINK([#include ], + [gethostbyname("www.dummysite.com");], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname]) + my_ac_link_result=success, + my_ac_link_result=failure + LIBS=$my_ac_save_LIBS + AC_MSG_RESULT(no) + ) + dnl At least one system has been identified to require BOTH nsl and dnl socket libs to link properly. -if test "$ac_cv_lib_nsl_gethostbyname" != "yes" -a "$ac_cv_lib_socket_gethostbyname" != "yes" -a "$ac_cv_func_gethostbyname" != "yes"; then +if test "$ac_cv_lib_nsl_gethostbyname" != "yes" -a "$ac_cv_lib_socket_gethostbyname" != "yes" -a "$ac_cv_func_gethostbyname" != "yes" -a "$my_ac_link_result" != "success" ; then AC_MSG_CHECKING([trying both nsl and socket libs]) my_ac_save_LIBS=$LIBS LIBS="-lnsl -lsocket $LIBS" @@ -231,7 +245,7 @@ my_ac_link_result=success, my_ac_link_result=failure ) - if test "$my_ac_link_result" = "failure"; then +if test "$my_ac_link_result" = "failure"; then AC_MSG_RESULT([no]) AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) dnl restore LIBS