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 this set of Makefile.am
variables:
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.
The other approach, the kitchen-sink module, is more advanced. See chapter Extending Gnulib.