When the close module is used on Windows, lib/close.c calls functions that are defined in libws2_32, but there is nothing that will cause us to link against that library. Thus, this commit adds $(LIB_CLOSE) to put on the linker command line to supply -lws2_32 when necessary.
This might need a little bit of explanation. When a program actually uses sockets, through the sockets module, $(LIBSOCKET) will link against the correct library. This change is useful for indirect use of the ws2_32 library, via e.g. the gethostname module. This commit is due to a problem showing up in PSPP. Comments? commit df1da811f288a89eb524a4176c6fd62bacfb954a Author: Ben Pfaff <[email protected]> Date: Thu Feb 5 22:11:57 2009 -0800 Fix link errors on Windows when close module is used. * modules/close: Add $(LIB_CLOSE) to Link section. * m4/close.m4 (gl_REPLACE_CLOSE): Substitute -lws2_32 into $(LIB_CLOSE) on Windows. diff --git a/ChangeLog b/ChangeLog index 3d87cd3..2d07367 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-05 Ben Pfaff <[email protected]> + + Fix link errors on Windows when close module is used. + * modules/close: Add $(LIB_CLOSE) to Link section. + * m4/close.m4 (gl_REPLACE_CLOSE): Substitute -lws2_32 into + $(LIB_CLOSE) on Windows. + 2009-02-05 Jim Meyering <[email protected]> still avoid unused-parameter warnings, but do it cleanly diff --git a/m4/close.m4 b/m4/close.m4 index fcc9fb1..29d3abd 100644 --- a/m4/close.m4 +++ b/m4/close.m4 @@ -22,4 +22,6 @@ AC_DEFUN([gl_REPLACE_CLOSE], fi REPLACE_CLOSE=1 gl_REPLACE_FCLOSE + LIB_CLOSE="-lws2_32" + AC_SUBST([LIB_CLOSE]) ]) diff --git a/modules/close b/modules/close index bb852d4..138be1b 100644 --- a/modules/close +++ b/modules/close @@ -19,6 +19,9 @@ Makefile.am: Include: <unistd.h> +Link: +$(LIB_CLOSE) + License: LGPLv2+ -- Ben Pfaff http://benpfaff.org
