Use configmake.
[gnulib.git] / doc / gnulib.texi
index c61ab57..23638c7 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo   @c -*-texinfo-*-
-@comment $Id: gnulib.texi,v 1.22 2006-06-19 20:40:26 karl Exp $
+@comment $Id: gnulib.texi,v 1.26 2006-07-19 21:48:14 dprice Exp $
 @comment %**start of header
 @setfilename gnulib.info
 @settitle GNU Gnulib
@@ -7,7 +7,7 @@
 @syncodeindex pg cp
 @comment %**end of header
 
-@set UPDATED $Date: 2006-06-19 20:40:26 $
+@set UPDATED $Date: 2006-07-19 21:48:14 $
 
 @copying
 This manual is for GNU Gnulib (updated @value{UPDATED}),
@@ -89,6 +89,8 @@ Getting started:
 * Out of memory handling::
 * Library version handling::
 * Regular expressions::
+* Windows sockets::
+* Libtool and Windows::
 @end menu
 
 
@@ -209,7 +211,7 @@ for.  This is how the library behaves by default.
 However, we realize that some applications may not want to have the
 GSS library abort execution in any situation.  The GSS library support
 a hook to let the application regain control and perform its own
-cleanups when an out of memory situation has occured.  The application
+cleanups when an out of memory situation has occurred.  The application
 can define a function (having a @code{void} prototype, i.e., no return
 value and no parameters) and set the library variable
 @code{xalloc_fail_func} to that function.  The variable should be
@@ -294,6 +296,59 @@ generated automatically.
 @include regexprops-generic.texi
 
 
+@node Windows sockets
+@section Windows sockets
+
+There are several issues when building applications that should work
+under Windows.  The most problematic part is for applications that use
+sockets.
+
+Hopefully, we can add helpful notes to this section that will help you
+port your application to Windows using gnulib.
+
+@subsection Getaddrinfo and WINVER
+
+This was written for the getaddrinfo module, but may be applicable to
+other functions too.
+
+The getaddrinfo function exists in ws2tcpip.h and -lws2_32 on Windows
+XP.  The function declaration is present if @code{WINVER >= 0x0501}.
+Windows 2000 does not have getaddrinfo in its @file{WS2_32.dll}.
+
+Thus, if you want to assume Windows XP or later, you can add
+AC_DEFINE(WINVER, 0x0501) to avoid compiling to (partial) getaddrinfo
+implementation.
+
+If you want to support Windows 2000, don't do anything, but be aware
+that gnulib will use its own (partial) getaddrinfo implementation even
+on Windows XP.  Currently the code does not attempt to determine if
+the getaddrinfo function is available during runtime.
+
+Todo: Make getaddrinfo.c open the WS2_32.DLL and check for the
+getaddrinfo symbol and use it if present, otherwise fall back to our
+own implementation.
+
+@node Libtool and Windows
+@section Libtool and Windows
+
+If you want it to be possible to cross-compile your program to MinGW
+and you use Libtool, you need to put:
+
+@example
+AC_LIBTOOL_WIN32_DLL
+@end example
+
+in your @file{configure.ac}.  This sets the correct names for the
+@code{OBJDUMP}, @code{DLLTOOL}, and @code{AS} tools for the build.
+
+If you are building a library, you will also need to pass
+@code{-no-undefined} to make sure Libtool produces a DLL for your
+library.  From a @file{Makefile.am}:
+
+@example
+libgsasl_la_LDFLAGS += -no-undefined
+@end example
+
 @include gnulib-tool.texi