From: Bruno Haible Date: Sun, 9 Sep 2007 13:20:45 +0000 (+0000) Subject: New chapter "POSIX Substitutes Library". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0db587b66cf7b3e3c741dcdb19855eb3745cc390;p=pspp New chapter "POSIX Substitutes Library". --- diff --git a/doc/gnulib.texi b/doc/gnulib.texi index 4abf6ed529..ebd1e5b7fc 100644 --- a/doc/gnulib.texi +++ b/doc/gnulib.texi @@ -1,5 +1,5 @@ \input texinfo @c -*-texinfo-*- -@comment $Id: gnulib.texi,v 1.43 2007-08-23 02:00:19 ericb Exp $ +@comment $Id: gnulib.texi,v 1.44 2007-09-09 13:20:45 haible 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: 2007-08-23 02:00:19 $ +@set UPDATED $Date: 2007-09-09 13:20:45 $ @copying This manual is for GNU Gnulib (updated @value{UPDATED}), @@ -51,7 +51,8 @@ Texts. A copy of the license is included in the section entitled * Introduction:: * Invoking gnulib-tool:: * Miscellaneous Notes:: -* Header File Substitutes:: +* POSIX Substitutes Library:: Building as a separate substitutes library. +* Header File Substitutes:: Overriding system headers. * Function Substitutes:: Replacing system functions. * Particular Modules:: Documentation of individual modules. * GNU Free Documentation License:: Copying and sharing this manual. @@ -418,6 +419,35 @@ autobuild-submit logs/* @end enumerate +@node POSIX Substitutes Library +@chapter Building the ISO C and POSIX Substitutes + +This section shows a radically different way to use Gnulib. + +You can extract the ISO C / POSIX substitutes part of gnulib by running +the command +@smallexample +gnulib-tool --create-testdir --source-base=lib \ + --dir=/tmp/posixlib `posix-modules` +@end smallexample + +@noindent +The command @samp{posix-modules} is found in the same directory as +@code{gnulib-tool}. + +The resulting directory can be built on a particular platform, +independently of the program being ported. Then you can configure and +build any program, by setting @code{CPPFLAGS} and @code{LDFLAGS} at +configure time accordingly: set @code{CPPFLAGS="-I.../posixlib/lib"}, plus +any essential type definitions and flags that you find in +@code{.../posixlib/config.h}, and set +@code{LDFLAGS=".../posixlib/lib/libgnu.a"}. + +This way of using Gnulib is useful when you don't want to modify the program's +source code, or when the program uses a mix between C and C++ sources +(requiring separate builds of the @code{posixlib} for the C compiler and +for the C++ compiler). + @node Header File Substitutes @chapter ISO C and POSIX Header File Substitutes