-If your gnulib source base is @file{gl}, you would use:
-
-@example
-AC_CONFIG_FILES(... gl/Makefile ...)
-@end example
-
-You must also make sure that @code{make} work in the gnulib directory.
-Add the gnulib source base directory to a @code{SUBDIRS} Makefile.am
-statement, as in:
-
-@example
-SUBDIRS = lib
-@end example
-
-or if you, more likely, already have a few entries in @code{SUBDIRS},
-you can add something like:
-
-@example
-SUBDIRS += lib
-@end example
-
-If you are using a gnulib source base of @code{gl}, you would use:
-
-@example
-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.
-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 -I$(top_builddir)/lib
-...
-LIBADD = lib/libgnu.a
-...
-@end example
-
-Don't forget to @code{#include} the various header files. In this
-example, you would need to make sure that @samp{#include "strdup.h"}
-is evaluated when compiling all source code files, that want to make
-use of @code{strdup}.
-
-When an include file is provided by the gnulib
-you shouldn't try to include the corresponding system header files
-yourself but let the gnulib header file do it as the ordering
-of the definition for some symbols may be significant.
-
-For example, to use the @code{time_r} gnulib module you should
-use include header file provided by the gnulib, and so
-@samp{#include "time_r.h"}, but you shouldn't explicitely
-@samp{#include <time.h>} as it is already done in @file{time_r.h}
-before the redefinition of some symbols.
-
-@node Importing updated files
-@section Importing updated files
-
-From time to time, you may want to invoke @samp{gnulib-tool --import}
-to update the files in your package. Once you have set up your
-package for gnulib, this step is quite simple. For example:
-
-@example
-~/src/libfoo$ gnulib-tool --import --source-base gl --m4-base gl/m4 strdup
-Module list with included dependencies:
- strdup
-File list:
- lib/strdup.c
- lib/strdup.h
- m4/onceonly_2_57.m4
- m4/strdup.m4
-Creating ./lib/Makefile.am...
-Creating ./m4/gnulib.m4...
-Finished.
-
-Don't forget to add "lib/Makefile"
-to AC_CONFIG_FILES in "./configure.ac" and to mention
-"lib" in SUBDIRS in some Makefile.am.
-~/src/libfoo$
-@end example
-
-If you don't recall how you invoked the tool last time, the commands
-used (and the operations it resulted in) are placed in comments within
-the generated @file{Makefile.am} and @file{gnulib.m4}, as in:
-
-@example
-...
-# Invoked as: gnulib-tool --import strdup
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --libtool strdup
-...
-@end example
-
-
-@node Finishing touches
-@section Finishing touches
-
-Invoking @samp{gnulib-tool --import} with the proper parameters (e.g.,
-@samp{--m4-base gl/m4}) and list of modules (e.g., @samp{strdup
-snprintf getline minmax}) can be tedious. To simplify this procedure,
-you may put the command line parameters in your @file{configure.ac}.
-For example:
-
-@example
-...
-AC_PROG_CC
-gl_EARLY
-...
-# For gnulib.
-gl_SOURCE_BASE(gl)
-gl_M4_BASE(gl/m4)
-gl_LIB(libgl)
-gl_MODULES(xmalloc progname strdup dummy exit error getpass-gnu getaddrinfo)
-gl_AVOID(xalloc-die)
-gl_INIT
-...
-@end example