Simon Josefsson wrote: > AC_SEARCH_LIBS(gethostbyname, [inet nsl]) > ... > if test "$ac_cv_search_gethostbyname" = "no"; then > save_LIBS="$LIBS" > LIBS="$LIBS -lwsock32" > AC_MSG_CHECKING([whether we need -lwsock32]) > AC_LINK_IFELSE([ > AC_LANG_PROGRAM([[ > #include <ws2tcpip.h>
Why do you include <ws2tcpip.h>, when the declaration is actually in <winsock2.h>? (At least it is in the mingw version I'm looking at.) > ]], [gethostbyname ("foo");])], > need_wsock32=yes, need_wsock32=no) > AC_MSG_RESULT($need_wsock32) > LIBS="$save_LIBS" > if test "$need_wsock32" = "yes"; then > LIBS="$LIBS -lwsock32" > fi > fi > > However, it seems rather ugly. No, it's fine: It adds to LIBS only what is needed. It works when cross-compiling. It uses the same technique as AC_SEARCH_LIBS. > I was hoping to be able to connect to > the AC_SEARCH_LIB logic somehow You are only working around the lack of a #includes section argument in the AC_SEARCH_LIBS macro. Bruno _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib