This may have been discussed before, but I don't recall a solution, so maybe a new report will help.
Gsasl and gnutls uses the close, socket and getline modules from gnulib. I get a problem when building gnulib's self-tests for mingw. You can reproduce it by using: rm -rf m gnulib-tool --create-testdir --with-tests --dir m close getdelim socket cd m ./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu make check The error is: i586-mingw32msvc-gcc -g -O2 -o test-getdelim.exe test-getdelim.o ../gllib/libgnu.a ../gllib/libgnu.a(close.o): In function `_gl_close_fd_maybe_socket': /home/jas/src/gnulib/m/gllib/close.c:39: undefined reference to `_wsaenumnetworkeve...@12' /home/jas/src/gnulib/m/gllib/close.c:46: undefined reference to `_closesoc...@4' ../gllib/libgnu.a(close.o): In function `set_winsock_errno': /home/jas/src/gnulib/m/gllib/w32sock.h:34: undefined reference to `_wsagetlaster...@0' /home/jas/src/gnulib/m/gllib/w32sock.h:35: undefined reference to `_wsasetlaster...@4' What appears to be missing is that -lws2_32 is added to the linker line. If I link the test-getdelim.exe program with -lws2_32 and re-run make check, everything works fine. Some ideas: 1) Should the sockets.m4 module unconditionally add LIBSOCKET to LDADD? 2) Should the gnulib-tool generated Makefile.am add LIBSOCKET to LDADD? Is there any other options? Thanks, /Simon