You can at any moment decide to use Gnulib differently than the last time.
There are two ways to change how Gnulib is used. Which one you’ll use,
depends on where you keep track of options and module names that you pass
to gnulib-tool.
gnulib-tool
again, with modified options and more or fewer module names.
gnulib-tool remembers which modules were used last time. If you
want to rely on gnulib-tool’s own memory of the last used
options and module names, you can use the commands
gnulib-tool --add-import and
gnulib-tool --remove-import.
So, if you only want to use more Gnulib modules, simply invoke
gnulib-tool --add-import new-modules. The list of
modules that you pass after ‘--add-import’ is added to the
previous list of modules.
Similarly, if you want to use fewer Gnulib modules, simply invoke
gnulib-tool --remove-import unneeded-modules. The list
of modules that you pass after ‘--remove-import’ is removed
from the previous list of modules. Note that if a module is then still
needed as dependency of other modules, it will be used nevertheless.
If you want to really not use a module any more, regardless of
whether other modules may need it, you need to use the ‘--avoid’
option.
For other changes, such as different choices of ‘--lib’, ‘--source-base’ or ‘--aux-dir’, the normal way is to modify manually the file gnulib-cache.m4 in the M4 macros directory, then launch ‘gnulib-tool --add-import’.
The only change for which this doesn’t work is a change of the
‘--m4-base’ directory. Because, when you pass a different value of
‘--m4-base’, gnulib-tool will not find the previous
gnulib-cache.m4 file any more. A possible solution is to
manually copy the gnulib-cache.m4 into the new M4 macro directory.
In the gnulib-cache.m4 file, the macros have the following meaning:
gl_LOCAL_DIRThe argument is a colon separated list of local directories where
gnulib-tool will search before looking at gnulib’s directory.
Corresponds to the ‘--local-dir’ command line argument.
gl_MODULESThe argument is a space separated list of the requested modules, not including dependencies.
gl_WITH_OBSOLETEThe presence of this macro corresponds to the ‘--with-obsolete’ command line argument. It takes no arguments.
gl_WITH_CXX_TESTSThe presence of this macro corresponds to the ‘--with-c++-tests’ command line argument and to the absence of the ‘--without-c++-tests’ command line argument. It takes no arguments.
gl_WITH_LONGRUNNING_TESTSThe presence of this macro corresponds to the ‘--with-longrunning-tests’ command line argument and to the absence of the ‘--without-longrunning-tests’ command line argument. It takes no arguments.
gl_WITH_PRIVILEGED_TESTSThe presence of this macro corresponds to the ‘--with-longrunning-tests’ command line argument and to the absence of the ‘--without-longrunning-tests’ command line argument. It takes no arguments.
gl_WITH_UNPORTABLE_TESTSThe presence of this macro corresponds to the ‘--with-unportable-tests’ command line argument and to the absence of the ‘--without-unportable-tests’ command line argument. It takes no arguments.
gl_WITH_ALL_TESTSThe presence of this macro corresponds to the ‘--with-all-tests’ command line argument. It takes no arguments.
gl_AVOIDThe argument is a space separated list of modules that should not be used, even if they occur as dependencies. Corresponds to the ‘--avoid’ command line argument.
gl_SOURCE_BASEThe argument is the relative file name of the directory containing the gnulib source files (mostly *.c and *.h files). Corresponds to the ‘--source-base’ command line argument.
gl_M4_BASEThe argument is the relative file name of the directory containing the gnulib M4 macros (*.m4 files). Corresponds to the ‘--m4-base’ command line argument.
gl_PO_BASEThe argument is the relative file name of the directory containing *.po files. Corresponds to the ‘--po-base’ command line argument.
gl_DOC_BASEThe argument is the relative file name of the directory containing documentation files. Corresponds to the ‘--doc-base’ command line argument.
gl_TESTS_BASEThe argument is the relative file name of the directory containing the gnulib unit test files. Corresponds to the ‘--tests-base’ command line argument.
gl_WITH_TESTSThe presence of this macro corresponds to the ‘--with-tests’ command line argument. It takes no arguments.
gl_LIBThe argument is the name of the library to be created. Corresponds to the ‘--lib’ command line argument.
gl_LGPLThe presence of this macro without arguments corresponds to the ‘--lgpl’ command line argument. The presence of this macro with an argument (whose value must be 2 or 3) corresponds to the ‘--lgpl=arg’ command line argument.
gl_GPLThe presence of this macro with an argument (whose value must be 2 or 3) corresponds to the ‘--gpl=arg’ command line argument.
gl_MAKEFILE_NAMEThe argument is the name of the makefile in the source-base and tests-base directories. Corresponds to the ‘--makefile-name’ command line argument.
gl_TESTS_MAKEFILE_NAMEThe argument is the name of the makefile in the tests-base directory. Corresponds to the ‘--tests-makefile-name’ command line argument.
gl_AUTOMAKE_SUBDIRThe presence of this macro corresponds to the ‘--automake-subdir’ command line argument. It takes no arguments.
gl_CONDITIONAL_DEPENDENCIESThe presence of this macro corresponds to the ‘--conditional-dependencies’ command line argument and to the absence of the ‘--no-conditional-dependencies’ command line argument. It takes no arguments.
gl_LIBTOOLThe presence of this macro corresponds to the ‘--libtool’ command line argument and to the absence of the ‘--no-libtool’ command line argument. It takes no arguments.
gl_MACRO_PREFIXThe argument is the prefix to use for macros in the gnulib-comp.m4 file. Corresponds to the ‘--macro-prefix’ command line argument.
gl_PO_DOMAINThe argument is the prefix of the i18n domain, typically matching the package name. Corresponds to the ‘--po-domain’ command line argument.
gl_WITNESS_C_MACROThe argument is the C macro that is defined when the sources in this directory are compiled or used. Corresponds to the ‘--witness-c-macro’ command line argument.
gl_VC_FILESThe argument to this macro is true or false. The former
corresponds to the ‘--vc-files’ command line argument and the latter
corresponds to the ‘--no-vc-files’ command line argument.