Next: Why doesn’t Automake support wildcards?, Previous: CVS and generated files, Up: Frequently Asked Questions about Automake [Contents][Index]
28.2 missing
and AM_MAINTAINER_MODE
missing
The missing
script is a wrapper around several maintainer
tools, designed to warn users if a maintainer tool is required but
missing. Typical maintainer tools are autoconf
,
automake
, bison
, etc. Because file generated by
these tools are shipped with the other sources of a package, these
tools shouldn’t be required during a user build and they are not
checked for in configure.
However, if for some reason a rebuild rule is triggered and involves a
missing tool, missing
will notice it and warn the user.
Besides the warning, when a tool is missing, missing
will
attempt to fix timestamps in a way that allows the build to continue.
For instance, missing
will touch configure if
autoconf
is not installed. When all distributed files are
kept under version control, this feature of missing
allows a
user with no maintainer tools to build a package off its version
control repository, bypassing any timestamp inconsistency (implied by
e.g. ‘cvs update’ or ‘git clone’).
If the required tool is installed, missing
will run it and
won’t attempt to continue after failures. This is correct during
development: developers love fixing failures. However, users with
wrong versions of maintainer tools may get an error when the rebuild
rule is spuriously triggered, halting the build. This failure to let
the build continue is one of the arguments of the
AM_MAINTAINER_MODE
advocates.
AM_MAINTAINER_MODE
AM_MAINTAINER_MODE
allows you to choose whether the so called
"rebuild rules" should be enabled or disabled. With
AM_MAINTAINER_MODE([enable])
, they are enabled by default,
otherwise they are disabled by default. In the latter case, if
you have AM_MAINTAINER_MODE
in configure.ac, and run
‘./configure && make’, then make
will *never* attempt to
rebuild configure, Makefile.ins, Lex or Yacc outputs, etc.
I.e., this disables build rules for files that are usually distributed
and that users should normally not have to update.
The user can override the default setting by passing either
‘--enable-maintainer-mode’ or ‘--disable-maintainer-mode’
to configure
.
People use AM_MAINTAINER_MODE
either because they do not want their
users (or themselves) annoyed by timestamps lossage (see CVS and generated files), or
because they simply can’t stand the rebuild rules and prefer running
maintainer tools explicitly.
AM_MAINTAINER_MODE
also allows you to disable some custom build
rules conditionally. Some developers use this feature to disable
rules that need exotic tools that users may not have available.
Several years ago François Pinard pointed out several arguments
against this AM_MAINTAINER_MODE
macro. Most of them relate to
insecurity. By removing dependencies you get non-dependable builds:
changes to sources files can have no effect on generated files and this
can be very confusing when unnoticed. He adds that security shouldn’t
be reserved to maintainers (what --enable-maintainer-mode
suggests), on the contrary. If one user has to modify a
Makefile.am, then either Makefile.in should be updated
or a warning should be output (this is what Automake uses
missing
for) but the last thing you want is that nothing
happens and the user doesn’t notice it (this is what happens when
rebuild rules are disabled by AM_MAINTAINER_MODE
).
Jim Meyering, the inventor of the AM_MAINTAINER_MODE
macro was
swayed by François’s arguments, and got rid of
AM_MAINTAINER_MODE
in all of his packages.
Still many people continue to use AM_MAINTAINER_MODE
, because
it helps them working on projects where all files are kept under version
control, and because missing
isn’t enough if you have the
wrong version of the tools.