Next: Miscellaneous, Previous: Rebuilding, Up: Top
Various features of Automake can be controlled by options. Except where
noted otherwise, options can be specified in one of several ways: Most
options can be applied on a per-Makefile basis when listed in a
special Makefile variable named AUTOMAKE_OPTIONS
. Some
of these options only make sense when specified in the toplevel
Makefile.am file. Options are applied globally to all processed
Makefile files when listed in the first argument of
AM_INIT_AUTOMAKE
in configure.ac, and some options which
require changes to the configure script can only be specified
there. These are annotated below.
Currently understood options are:
dist-bzip2
to dist
.
dist-lzma
to dist
.
dist-shar
to dist
.
dist-zip
to dist
.
dist-tarZ
to dist
.
AM_INIT_AUTOMAKE
in
configure.ac, it will be ignored otherwise. It will also be
ignored in sub-packages of nested packages (see Subpackages).
AM_INIT_AUTOMAKE
. It will prevent the PACKAGE
and
VERSION
variables from being AC_DEFINE
d.
dist
target. This is useful
when a package has its own method for making distributions.
dist-gzip
to dist
.
foo
, it
will override a rule for a target named ‘foo$(EXEEXT)’. This is
necessary when EXEEXT
is found to be empty. However, by
default automake will generate an error for this use. The
no-exeext option will disable this error. This is intended for
use only where it is known in advance that the package will not be
ported to Windows, or any other operating system using extensions on
executables.
info
and install-info
targets will still be available. This option is disallowed at
gnu strictness and above.
install-man
target will still
be available for optional installation. This option is disallowed at
gnu strictness and above.
TESTS
that can run tests in parallel
(see Simple Tests using parallel-tests, for more information).
GEN output-file
instead of printing the command that will be executed to update output-file. It can also silence libtool output.
To enable less verbose build rules, both the developer and the user of the package have to take a number of steps. The developer needs to do either of the following:
AM_INIT_AUTOMAKE
.
AM_SILENT_RULES
macro from within the configure.ac
file.
It is not possible to instead specify silent-rules in a Makefile.am file.
If the developer has done either of the above, then the user of the package may influence the verbosity at configure run time as well as at make run time:
make V=1
will produce verbose output,
make V=0
less verbose output.
For portability to different make implementations, package authors
are advised to not set the variable V
inside the Makefile.am
file, to allow the user to override the value for subdirectories as well.
The current implementation of this feature relies on a non-POSIX, but in practice rather widely supported Makefile construct of nested variable expansion ‘$(var1$(V))’. Do not use the silent-rules option if your package needs to build with make implementations that do not support it. The silent-rules option turns off warnings about recursive variable expansion, which are in turn enabled by -Wportability (see Invoking Automake).
To extend the silent mode to your own rules, you have two choices:
AM_V_GEN
as a prefix to
commands that should output a status line in silent mode, and
AM_V_at
as a prefix to commands that should not output anything
in silent mode. When output is to be verbose, both of these variables
will expand to the empty string.
AM_V_GEN
:
pkg_verbose = $(pkg_verbose_$(V)) pkg_verbose_ = $(pkg_verbose_$(AM_DEFAULT_VERBOSITY)) pkg_verbose_0 = @echo GEN $@; foo: foo.in $(pkg_verbose)cp $(srcdir)/foo.in $@
installcheck
rule check that installed scripts and
programs support the --help and --version options.
This also provides a basic check that the program's
run-time dependencies are satisfied after installation.
In a few situations, programs (or scripts) have to be exempted from this
test. For instance, false (from GNU sh-utils) is never
successful, even for --help or --version. You can list
such programs in the variable AM_INSTALLCHECK_STD_OPTIONS_EXEMPT
.
Programs (not scripts) listed in this variable should be suffixed by
‘$(EXEEXT)’ for the sake of Win32 or OS/2. For instance, suppose we
build false as a program but true.sh as a script, and that
neither of them support --help or --version:
AUTOMAKE_OPTIONS = std-options bin_PROGRAMS = false ... bin_SCRIPTS = true.sh ... AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = false$(EXEEXT) true.sh
In order to use this option with C sources, you should add
AM_PROG_CC_C_O
to configure.ac.
These options must be passed as arguments to AM_INIT_AUTOMAKE
(see Macros) because they can require additional configure checks.
Automake will complain if it sees such options in an
AUTOMAKE_OPTIONS
variable.
tar-v7 selects the old V7 tar format. This is the historical default. This antiquated format is understood by all tar implementations and supports file names with up to 99 characters. When given longer file names some tar implementations will diagnose the problem while other will generate broken tarballs or use non-portable extensions. Furthermore, the V7 format cannot store empty directories. When using this format, consider using the filename-length-max=99 option to catch file names too long.
tar-ustar selects the ustar format defined by POSIX 1003.1-1988. This format is believed to be old enough to be portable. It fully supports empty directories. It can store file names with up to 256 characters, provided that the file name can be split at directory separator in two parts, first of them being at most 155 bytes long. So, in most cases the maximum file name length will be shorter than 256 characters. However you may run against broken tar implementations that incorrectly handle file names longer than 99 characters (please report them to bug-automake@gnu.org so we can document this accurately).
tar-pax selects the new pax interchange format defined by POSIX 1003.1-2001. It does not limit the length of file names. However, this format is very young and should probably be restricted to packages that target only very modern platforms. There are moves to change the pax format in an upward-compatible way, so this option may refer to a more recent version in the future.
See Controlling the Archive Format, for further discussion about tar formats.
configure knows several ways to construct these formats. It
will not abort if it cannot find a tool up to the task (so that the
package can still be built), but ‘make dist’ will fail.
Unrecognized options are diagnosed by automake.
If you want an option to apply to all the files in the tree, you can use
the AM_INIT_AUTOMAKE
macro in configure.ac.
See Macros.