changeset 39179:c1c9d3013c37

doc: New section "Modifying the build rules of a Gnulib import directory". * doc/gnulib-tool.texi (Modified build rules): New node.
author Bruno Haible <bruno@clisp.org>
date Sun, 10 Dec 2017 16:28:43 +0100
parents 81d47bfd0911
children eb2faa3cbde4
files ChangeLog doc/gnulib-tool.texi
diffstat 2 files changed, 74 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Dec 10 14:00:43 2017 +0100
+++ b/ChangeLog	Sun Dec 10 16:28:43 2017 +0100
@@ -1,3 +1,8 @@
+2017-12-10  Bruno Haible  <bruno@clisp.org>
+
+	doc: New sect. "Modifying the build rules of a Gnulib import directory".
+	* doc/gnulib-tool.texi (Modified build rules): New node.
+
 2017-12-10  Bruno Haible  <bruno@clisp.org>
 
 	doc: Tweak wording.
--- a/doc/gnulib-tool.texi	Sun Dec 10 14:00:43 2017 +0100
+++ b/doc/gnulib-tool.texi	Sun Dec 10 16:28:43 2017 +0100
@@ -44,6 +44,7 @@
 * Modified imports::            Changing the import specification.
 * Simple update::               Tracking Gnulib development.
 * Source changes::              Impact of Gnulib on your source files.
+* Modified build rules::        Modifying the build rules of a Gnulib import
 * Multiple instances::          Using Gnulib for both a library and a program
 * gettextize and autopoint::    Caveat: @code{gettextize} and @code{autopoint} users!
 * Localization::                Handling Gnulib's own message translations.
@@ -451,6 +452,74 @@
 and these flags have no effect after any system header file has been included.
 
 
+@node Modified build rules
+@section Modifying the build rules of a Gnulib import directory
+
+In some cases, you may want to set additional compiler options for
+use within the Gnulib import directory.  For example, the
+@samp{relocatable} module operates better if you define the C macros
+@code{ENABLE_COSTLY_RELOCATABLE} and @code{INSTALLDIR} during its
+compilation.
+
+There are two ways to do so: Use of the @code{gnulib-tool} option
+@code{--makefile-name}, and a kitchen-sink module.
+
+With the @code{gnulib-tool} option @code{--makefile-name}, you are
+telling @code{gnulib-tool} to generate an includable @code{Makefile.am}
+portion, rather than a self-contained @code{Makefile.am}.  For example,
+when you use @code{--makefile-name=Makefile.gnulib}, @code{gnulib-tool}
+will generate @code{Makefile.gnulib}, and you will provide a
+hand-written @code{Makefile.am} that includes @code{Makefile.gnulib}
+through a line such as
+@smallexample
+include Makefile.gnulib
+@end smallexample
+Before this include, you need to initialize this set of @code{Makefile.am}
+variables:
+@itemize @bullet
+@item
+@code{AUTOMAKE_OPTIONS}
+@item
+@code{SUBDIRS}
+@item
+@code{noinst_HEADERS}
+@item
+@code{noinst_LIBRARIES}
+@item
+@code{noinst_LTLIBRARIES}
+@item
+@code{pkgdata_DATA} (only with Automake @geq{} 1.11.4)
+@item
+@code{EXTRA_DIST}
+@item
+@code{BUILT_SOURCES}
+@item
+@code{SUFFIXES}
+@item
+@code{MOSTLYCLEANFILES}
+@item
+@code{MOSTLYCLEANDIRS}
+@item
+@code{CLEANFILES}
+@item
+@code{DISTCLEANFILES}
+@item
+@code{MAINTAINERCLEANFILES}
+@item
+@code{AM_CPPFLAGS}
+@item
+@code{AM_CFLAGS}
+@end itemize
+@code{AUTOMAKE_OPTIONS} should be initialized as described in
+@ref{Options,,Changing Automake's Behavior,automake,GNU Automake}.
+The other variables can be initialized to empty.  However, you will most
+likely want to initialize some of them with non-empty values, in order
+to achieve the desired customization.
+
+The other approach, the kitchen-sink module, is more advanced.  See
+chapter @ref{Extending Gnulib}.
+
+
 @node Multiple instances
 @section Using Gnulib for both a library and a program