In some cases, you may want to set additional compiler options for
use within the Gnulib import directory. For example, the
‘relocatable’ module operates better if you define the C macros
ENABLE_COSTLY_RELOCATABLE and INSTALLDIR during its
compilation.
There are two ways to do so: Use of the gnulib-tool option
--makefile-name, and a kitchen-sink module.
With the gnulib-tool option --makefile-name, you are
telling gnulib-tool to generate an includable Makefile.am
portion, rather than a self-contained Makefile.am. For example,
when you use --makefile-name=Makefile.gnulib, gnulib-tool
will generate Makefile.gnulib, and you will provide a
hand-written Makefile.am that includes Makefile.gnulib
through a line such as
include Makefile.gnulib
Before this include, you need to initialize a set of Makefile.am
variables.
For the directory into which gnulib-tool copies the gnulib source files,
the set of variables to initialize is:
AUTOMAKE_OPTIONS
SUBDIRS
noinst_HEADERS
noinst_LIBRARIES
noinst_LTLIBRARIES
pkgdata_DATA (only with Automake ≥ 1.11.4)
EXTRA_DIST
BUILT_SOURCES
SUFFIXES
MOSTLYCLEANFILES
MOSTLYCLEANDIRS
CLEANFILES
DISTCLEANFILES
MAINTAINERCLEANFILES
AM_CPPFLAGS
AM_CFLAGS
AUTOMAKE_OPTIONS should be initialized as described in
Changing Automake’s Behavior in 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.
For the directory into which gnulib-tool copies
the gnulib unit test files
(when option ‘--with-tests’ is used),
the set of variables to initialize is:
AM_CFLAGS
AM_CXXFLAGS (when this directory contains some C++ code)
The other approach, the kitchen-sink module, is more advanced. See chapter Extending Gnulib.