X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=doc%2Fgnulib.texi;h=15c19b22a9032771475094edbb13ce865e3b2b2e;hb=e1122a27ec42a7425ff3c18db93816112a2c7562;hp=8f6a41fda32111529ae5edf1450dbaf3967051c5;hpb=c0d8d21d1f6c731c09350f67e5dc9f4e196fee36;p=gnulib.git diff --git a/doc/gnulib.texi b/doc/gnulib.texi index 8f6a41fda..15c19b22a 100644 --- a/doc/gnulib.texi +++ b/doc/gnulib.texi @@ -1,5 +1,5 @@ \input texinfo @c -*-texinfo-*- -@comment $Id: gnulib.texi,v 1.12 2005-07-11 16:45:26 haible Exp $ +@comment $Id: gnulib.texi,v 1.16 2005-08-11 10:08:57 jas 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: 2005-07-11 16:45:26 $ +@set UPDATED $Date: 2005-08-11 10:08:57 $ @copying This manual is for GNU Gnulib (updated @value{UPDATED}), @@ -87,6 +87,7 @@ Getting started: * inet_ntoa:: * Out of memory handling:: * Library version handling:: +* Regular expressions:: @end menu @@ -295,7 +296,7 @@ fail. @node Library version handling @section Library version handling -The module ``check_version'' can be useful when your gnulib +The module @samp{check-version} can be useful when your gnulib application is a system library. You will typically wrap the call to the @code{check_version} function through a library API, your library header file may contain: @@ -306,8 +307,16 @@ header file may contain: extern const char *stringprep_check_version (const char *req_version); @end example -The implementation of @code{stringprep_check_version} would simply -pass on the call to @code{check_version}. +To avoid ELF symbol collisions with other libraries that use the +@samp{check-version} module, add to @file{config.h} through a +AC_DEFINE something like: + +@example +AC_DEFINE(check_version, stringprep_check_version, [Rename check_version.]) +@end example + +The @code{stringprep_check_version} function will thus be implemented +by the @code{check_version} module. There are two uses of the interface. The first is a way to provide for applications to find out the version number of the library it @@ -338,6 +347,17 @@ Typical uses look like: @end example +@node Regular expressions +@section Regular expressions + +Gnulib supports many different types of regular expressions; although +the underlying features are the same or identical, the syntax used +varies. The descriptions given here for the different types are +generated automatically. + +@include regexprops-generic.texi + + @node Invoking gnulib-tool @chapter Invoking gnulib-tool @@ -393,12 +413,15 @@ By default, the source code is copied into @file{lib/} and the M4 macros in @file{m4/}. You can override these paths by using @code{--source-base=DIRECTORY} and @code{--m4-base=DIRECTORY}, or by adding @samp{gl_SOURCE_BASE(DIRECTORY)} and -@samp{gl_M4_BASE(DIRECTORY)} to your @file{configure.ac}. -Some modules also provide other files necessary -for building. These files are copied into the directory specified -by @samp{AC_CONFIG_AUX_DIR} in @file{configure.ac} or by the -@code{--aux-dir=DIRECTORY} option. If neither is specified, the -current directory is assumed. +@samp{gl_M4_BASE(DIRECTORY)} to your @file{configure.ac}. Some +modules also provide other files necessary for building. These files +are copied into the directory specified by @samp{AC_CONFIG_AUX_DIR} in +@file{configure.ac} or by the @code{--aux-dir=DIRECTORY} option. If +neither is specified, the current directory is assumed. If a module +is automatically added as a dependency is added, that you wish to +avoid, you may use @code{--avoid=MODULE}, possibly several times. Of +course, you will then need to implement the same interface as the +removed module. @code{gnulib-tool} can make symbolic links instead of copying the source files. Use the @code{--symbolic} @@ -503,12 +526,14 @@ SUBDIRS += gl @end example Finally, you have to add compiler and linker flags in the appropriate -source directories, so that you can make use -of the gnulib library. For example: +source directories, so that you can make use of the gnulib library. +Since some modules (@samp{getopt}, for example) may copy files into +the build directory, @file{top_builddir/lib} is needed as well +as @file{top_srcdir/lib}. For example: @example ... -AM_CPPFLAGS = -I$(top_srcdir)/lib +AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_builddir)/lib ... LIBADD = lib/libgnu.a ... @@ -586,7 +611,8 @@ gl_EARLY gl_SOURCE_BASE(gl) gl_M4_BASE(gl/m4) gl_LIB(libgl) -gl_MODULES(getopt progname strdup dummy exit error getpass-gnu getaddrinfo) +gl_MODULES(xmalloc progname strdup dummy exit error getpass-gnu getaddrinfo) +gl_AVOID(xalloc-die) gl_INIT ... @end example @@ -600,7 +626,8 @@ The macros @code{gl_EARLY}, @code{gl_INIT}, @code{gl_SOURCE_BASE}, and macro can be used if you wish to change the library name (by default @file{libgnu.a} or @file{libgnu.la} if you use libtool). The @code{gl_MODULES} macro is used to specify which modules to import. - +@code{gl_AVOID} macro is used to specify which modules, that are +normally automatically added as a dependency, to avoid. @node Copying This Manual @appendix Copying This Manual