]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
automake: '--add-missing' is on by default experimental/ng/incompat-simplifications
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 20:42:56 +0000 (22:42 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 21:50:02 +0000 (23:50 +0200)
This commit modifies the automake script will always act as if the
'--add-missing' option were give, and simplifies the documentation
accordingly.

Future commits will take care of cleaning up the code accordingly.

The new semantics introduced with this change should have ideally
been the default in automake mainline as well, but they are not,
likely for historical reasons (as is the case for too many Automake
warts).

The new semantics also prepare the way for an exciting planning
change: the distribution of (at first only few) makefile fragments
to be included at make runtime in the Automake-generated Makefiles,
instead of having their contents copied over and over in said
Makefiles.

* automake.in ($add_missing): Define to '1' unconditionally.
(parse_arguments): The '-a' a.k.a. '--add-missing' option is
now a no-op.
* doc/automake-ng.texi: Adjust, in particular with the addition
of ...
(Auxiliary files): ... this new node.
* NG-NEWS: Update.
* t/add-missing.tap: Simplify: don't check that , if any required
auxiliary file is missing and automake is called without the '-a'
or '--add-missing' option, it complains and error out; this is not
the case anymore.  Also, don't call automake with the '-a' or
'--add-missing' option; there's no need to now.
* t/dist-auxfile.sh: Adjust.
* t/license2.sh: Likewise.
* t/per-target-flags.sh: Likewise.
* t/python.sh: Likewise.
* t/missing-auxfile-stops-makefiles-creation.sh: Remove as obsolete.
* t/mdate.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NG-NEWS
automake.in
doc/automake-ng.texi
t/add-missing.tap
t/ar-lib7.sh [deleted file]
t/dist-auxfile.sh
t/license2.sh
t/mdate.sh [deleted file]
t/missing-auxfile-stops-makefiles-creation.sh [deleted file]
t/per-target-flags.sh
t/python.sh

diff --git a/NG-NEWS b/NG-NEWS
index ad9ef179b5ce790c68c02faabb2f4c4d8cd3bf61..4980575001feee68dc7c17d5dc0c8e7e50606193 100644 (file)
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -395,6 +395,11 @@ Miscellaneous
   the files listed in $(BUILT_SOURCES) will be built not only before the
   "all", "check" or "install" targets, but before *any* target.
 
+* Automake-NG *always* install install missing required auxiliary file
+  and scripts (e.g., 'install-sh', or 'texinfo.tex' if info_TEXINFOS is
+  used).  So, it always behaves like mainline Automake does when the
+  '--add-missing' option is passed to it.
+
 -----
 
 Copyright (C) 2012 Free Software Foundation, Inc.
index f37e102d4f8d7f894234f4c838b84cfa574de479..d5782e842f940d6080c6c5c1a7acc84984ea0a2b 100644 (file)
@@ -292,7 +292,8 @@ my $force_generation = 1;
 my $symlink_exists = (eval 'symlink ("", "");', $@ eq '');
 
 # TRUE if missing standard files should be installed.
-my $add_missing = 0;
+# ALWAYS TRUE NOW!
+my $add_missing = 1;
 
 # TRUE if we should copy missing files; otherwise symlink if possible.
 my $copy_missing = 0;
@@ -7067,7 +7068,9 @@ sub parse_arguments ()
      'i|ignore-deps'   => sub { $ignore_deps = 1; },
      'no-force'        => sub { $force_generation = 0; },
      'f|force-missing'  => \$force_missing,
-     'a|add-missing'   => \$add_missing,
+     # Always true these days.  The option is still recognized as a
+     # no-op only for compatibility with mainline automake.
+     'a|add-missing'   => sub { },
      'c|copy'          => \$copy_missing,
      'v|verbose'       => sub { setup_channel 'verb', silent => 0; },
      'W|warnings=s'     => \@warnings,
index 37d251093544ff9156dfbf12a7d866de15545072..f6b1215657a04af653c28aaac421f490178c248e 100644 (file)
@@ -161,6 +161,7 @@ General ideas
 
 * General Operation::           General operation of Automake
 * Strictness::                  Standards conformance checking
+* Auxiliary files::             Automatic installation of auxiliary files
 * Uniform::                     The Uniform Naming Scheme
 * Length Limitations::          Staying below the command line length limit
 * Canonicalization::            How derived variables are named
@@ -1783,6 +1784,7 @@ understand how Automake works.
 @menu
 * General Operation::           General operation of Automake
 * Strictness::                  Standards conformance checking
+* Auxiliary files::             Automatic installation of auxiliary files
 * Uniform::                     The Uniform Naming Scheme
 * Length Limitations::          Staying below the command line length limit
 * Canonicalization::            How derived variables are named
@@ -1965,6 +1967,29 @@ standard is actually published (which may never happen).
 @xref{Gnits}, for more information on the precise implications of the
 strictness level.
 
+@node Auxiliary files
+@section Automatic installation of auxiliary files
+
+Automake requires certain common files to exist in certain situations;
+for instance, @file{config.guess} is required if @file{configure.ac}
+invokes @code{AC_CANONICAL_HOST}.  Automake is distributed with several
+of these files (@pxref{Auxiliary Programs}); @command{automake} will
+automatically add the missing required files to the package, whenever
+needed.
+By default Automake tries to make a symbolic link pointing to its own
+copy of the missing file; this can be changed with @option{--copy}.
+
+Many of the potentially-missing files are common scripts whose
+location may be specified via the @code{AC_CONFIG_AUX_DIR} macro.
+Therefore, @code{AC_CONFIG_AUX_DIR}'s setting affects whether a
+file is considered missing, and where the missing file is added
+(@pxref{Optional}).
+
+In some strictness modes, additional files are installed, see
+@ref{Gnits} for more information.
+
+@cindex auxiliary files, automatic installation
+@cindex Automatic installation of auxiliary files
 
 @node Uniform
 @section The Uniform Naming Scheme
@@ -2416,9 +2441,8 @@ zardoz_LDADD = $(LIBOBJS)
 info_TEXINFOS = zardoz.texi
 @end example
 
-Now you can run @samp{automake --add-missing} to generate your
-@file{Makefile.in} and grab any auxiliary files you might need, and
-you're done!
+Now you can run @samp{automake} to generate your @file{Makefile.in} and
+grab any auxiliary files you might need, and you're done!
 
 
 @node true
@@ -2552,28 +2576,6 @@ have to run @command{autoconf} yourself for this purpose.
 @cindex @file{config.guess}
 
 @table @code
-@item -a
-@itemx --add-missing
-@opindex -a
-@opindex --add-missing
-Automake requires certain common files to exist in certain situations;
-for instance, @file{config.guess} is required if @file{configure.ac} invokes
-@code{AC_CANONICAL_HOST}.  Automake is distributed with several of these
-files (@pxref{Auxiliary Programs}); this option will cause the missing
-ones to be automatically added to the package, whenever possible.  In
-general if Automake tells you a file is missing, try using this option.
-By default Automake tries to make a symbolic link pointing to its own
-copy of the missing file; this can be changed with @option{--copy}.
-
-Many of the potentially-missing files are common scripts whose
-location may be specified via the @code{AC_CONFIG_AUX_DIR} macro.
-Therefore, @code{AC_CONFIG_AUX_DIR}'s setting affects whether a
-file is considered missing, and where the missing file is added
-(@pxref{Optional}).
-
-In some strictness modes, additional files are installed, see @ref{Gnits}
-for more information.
-
 @item --libdir=@var{dir}
 @opindex --libdir
 Look for Automake data files in directory @var{dir} instead of in the
@@ -2589,17 +2591,17 @@ scripts and data files (like e.g., @file{texinfo.texi} and
 @opindex -c
 @itemx --copy
 @opindex --copy
-When used with @option{--add-missing}, causes installed files to be
-copied.  The default is to make a symbolic link.
+Causes standard files (if any) to be copied.  The default is to make a
+symbolic link.
 
 @item -f
 @opindex -f
 @itemx --force-missing
 @opindex --force-missing
-When used with @option{--add-missing}, causes standard files to be reinstalled
-even if they already exist in the source tree.  This involves removing
-the file from the source tree before creating the new symlink (or, with
-@option{--copy}, copying the new file).
+Causes standard files to be reinstalled even if they already exist in
+the source tree.  This involves removing the file from the source tree
+before creating the new symlink (or, with @option{--copy}, copying the
+new file).
 
 @item --foreign
 @opindex --foreign
@@ -6845,7 +6847,7 @@ dependencies are computed by running all compilations through a
 special wrapper program called @command{depcomp}.  @command{depcomp}
 understands how to coax many different C and C++ compilers into
 generating dependency information in the format it requires.
-@samp{automake -a} will install @command{depcomp} into your source
+@samp{automake} will install @command{depcomp} into your source
 tree for you.  If @command{depcomp} can't figure out how to properly
 invoke your compiler, dependency tracking will simply be disabled for
 your build.
@@ -7800,8 +7802,7 @@ was last modified.
 
 The @file{version.texi} support requires the @command{mdate-sh}
 script; this script is supplied with Automake and automatically
-included when @command{automake} is invoked with the
-@option{--add-missing} option.
+included when @command{automake} is invoked.
 
 If you have multiple Texinfo files, and you want to use the
 @file{version.texi} feature, then you have to have a separate version
@@ -7828,8 +7829,8 @@ the same directory as the @file{Makefile.am} file that lists the
 @file{.texi} files.  If you used @code{AC_CONFIG_AUX_DIR} in
 @file{configure.ac} (@pxref{Input, , Finding `configure' Input,
 autoconf, The Autoconf Manual}), then @file{texinfo.tex} is looked for
-there.  In both cases, @command{automake} then supplies @file{texinfo.tex} if
-@option{--add-missing} is given, and takes care of its distribution.
+there.  In both cases, @command{automake} then supplies @file{texinfo.tex}
+and takes care of its distribution.
 However, if you set the @code{TEXINFO_TEX} variable (see below),
 it overrides the location of the file and turns off its installation
 into the source as well as its distribution.
@@ -8312,7 +8313,7 @@ in @file{configure.ac}).  Also, files that are read by @command{configure}
 Autoconf macros such as @code{AC_CONFIG_FILES} and siblings) are
 automatically distributed.  Files included in a @file{Makefile.am} (using
 @code{include}) or in @file{configure.ac} (using @code{m4_include}), and
-helper scripts installed with @samp{automake --add-missing} are also
+helper scripts installed by @samp{automake} itself are also
 distributed.
 
 @vindex EXTRA_DIST
@@ -10809,7 +10810,7 @@ The files @file{INSTALL}, @file{NEWS}, @file{README}, @file{AUTHORS},
 and @file{ChangeLog}, plus one of @file{COPYING.LIB}, @file{COPYING.LESSER}
 or @file{COPYING}, are required at the topmost directory of the package.
 
-If the @option{--add-missing} option is given, @command{automake} will
+@command{automake} will by default
 add a generic version of the @file{INSTALL} file as well as the
 @file{COPYING} file containing the text of the current version of the
 GNU General Public License existing at the time of this Automake release
@@ -11259,10 +11260,10 @@ Automake places no restrictions on the distribution of the resulting
 distribute their work under terms like those of the GPL, but doing so
 is not required to use Automake.
 
-Some of the files that can be automatically installed via the
-@option{--add-missing} switch do fall under the GPL@.  However, these also
-have a special exception allowing you to distribute them with your
-package, regardless of the licensing you choose.
+Some of the files that can be automatically installed bu @command{automake}
+do fall under the GPL@.  However, these also have a special exception
+allowing you to distribute them with your package, regardless of the
+licensing you choose.
 
 
 @node API Versioning
@@ -11343,12 +11344,12 @@ Automake maintains three kind of files in a package.
 @item auxiliary tools like @file{install-sh} or @file{py-compile}
 @end itemize
 
-@file{aclocal.m4} is generated by @command{aclocal} and contains some
-Automake-supplied M4 macros.  Auxiliary tools are installed by
-@samp{automake --add-missing} when needed.  @file{Makefile.in}s are
-built from @file{Makefile.am} by @command{automake}, and rely on the
-definitions of the M4 macros put in @file{aclocal.m4} as well as the
-behavior of the auxiliary tools installed.
+@file{aclocal.m4} is generated by @command{aclocal} and contains
+some Automake-supplied M4 macros.  Auxiliary tools are installed
+by @samp{automake} when needed.  @file{Makefile.in}s are built
+from @file{Makefile.am} by @command{automake}, and rely on the
+definitions of the M4 macros put in @file{aclocal.m4} as well as
+the behavior of the auxiliary tools installed.
 
 Because all of these files are closely related, it is important to
 regenerate all of them when upgrading to a newer Automake release.
@@ -11357,7 +11358,7 @@ The usual way to do that is
 @example
 aclocal # with any option needed (such a -I m4)
 autoconf
-automake --add-missing --force-missing
+automake --force-missing
 @end example
 
 @noindent
index c47382b5f77de7f24a71f49aaf79f788b412a51a..45cc16e4e2c24c7e0d1c10d0a603661174bfa67a 100755 (executable)
@@ -153,30 +153,13 @@ check_ ()
   # Test once with '--copy', once without.
   for action in link copy; do
     case $action in
-      link) opts='--add-missing';;
-      copy) opts='-a --copy';;
+      link) opts=;;
+      copy) opts=--copy;;
          *) fatal_ "invalid value '$action' for \$action";;
     esac
     pfx="[$action $name]"
     cp -R generic $action
     cd $action
-    # If the required auxiliary files are missing, and automake is
-    # not told to install them, it should complain and error out,
-    # and also give a useful suggestion.
-    AUTOMAKE_fails -d "$pfx missing files, automake fails"
-    for f in $files; do
-      command_ok_ \
-        "$pfx warn about missing file $f" \
-        $FGREP "required file '$build_aux/$f' not found" stderr
-      # Suggest the user to use '--add-missing'.
-      command_ok_ \
-        "$pfx suggest --add-missing for $f" \
-        grep ".*--add-missing.* install .*'$f'" stderr
-    done
-    # No files should be automatically installed by automake if it
-    # is not told to.
-    if ls "$build_aux" | grep .; then r='not ok'; else r=ok; fi
-    result_ "$r" "$pfx no extra files installed"
     AUTOMAKE_run -d "$pfx automake run successfully" -- $opts
     ls -l . $build_aux
     # The expected files should get installed correctly (e.g., no
diff --git a/t/ar-lib7.sh b/t/ar-lib7.sh
deleted file mode 100755 (executable)
index c27cabf..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Test if automake warns if ar-lib is missing when AM_PROG_AR is used.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AM_PROG_AR
-END
-
-:> Makefile.am
-
-$ACLOCAL
-AUTOMAKE_fails
-
-grep '^configure\.ac:.*ar-lib.*not found' stderr
-
-$AUTOMAKE --add-missing
-
-:
index 763b14ea0f8b0b8ee056599070c597e76fc8feb6..4389f514f3e6476fc10cd99042e4bde14bbd434d 100755 (executable)
@@ -79,8 +79,6 @@ END
   grep "^configure\\.ac:6:.* required file.*$auxdir_rx/zardoz"    stderr
 
   touch $auxdir/foo.txt $auxdir/bar.sh $auxdir/zardoz
-  cp "$am_scriptdir"/missing "$am_scriptdir"/install-sh $auxdir \
-    || fatal_ "fetching auxiliary scripts 'missing' and 'install-sh'"
   $AUTOMAKE
   ./configure
   $MAKE test
index 736e96fa0b09c60966e77b4be101010ecd1e9b88..02d48fd77ccf99fe0821169d77d0025eaf483a30 100755 (executable)
@@ -29,11 +29,10 @@ END
 : >INSTALL
 
 $ACLOCAL
-AUTOMAKE_fails
-grep 'COPYING' stderr
-
-AUTOMAKE_run --add-missing
+AUTOMAKE_run
 grep 'COPYING' stderr
 grep 'GNU General Public License' stderr
 grep 'Consider adding.*version control' stderr
 test -f COPYING
+
+:
diff --git a/t/mdate.sh b/t/mdate.sh
deleted file mode 100755 (executable)
index e44144a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Test that mdate-sh is required when Texinfo used and version.texi needed.
-
-. ./defs || exit 1
-
-cat > Makefile.am << 'END'
-info_TEXINFOS = textutils.texi
-END
-
-cat > textutils.texi << 'END'
-@include version.texi
-@setfilename textutils.info
-END
-
-# Required when using Texinfo.
-: > texinfo.tex
-
-$ACLOCAL
-AUTOMAKE_fails
-grep 'required file.*mdate-sh.*not found' stderr
-
-:
diff --git a/t/missing-auxfile-stops-makefiles-creation.sh b/t/missing-auxfile-stops-makefiles-creation.sh
deleted file mode 100755 (executable)
index d1c0cd4..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Automake should stop the creation of Makefile.in files at the first
-# encountered error due to a required auxiliary file not found.
-
-. ./defs || exit 1
-
-cat >> configure.ac <<END
-AM_PATH_PYTHON
-END
-
-echo SUBDIRS = > Makefile.am
-
-for i in 1 2 3 4 5; do
-  echo "AC_CONFIG_FILES([sub$i/Makefile])" >> configure.ac
-  echo "SUBDIRS += sub$i" >> Makefile.am
-  mkdir sub$i
-  echo python_PYTHON = foo.py > sub$i/Makefile.am
-done
-
-: > sub1/Makefile.am
-
-$ACLOCAL
-
-unset AUTOMAKE_JOBS || :
-
-AUTOMAKE_fails
-ls -l Makefile.in */Makefile.in || : # For debugging.
-# Top-level Makefile.in might be created or not, we don't want to set
-# too strict semantics here, so don't check for it.  But the later
-# files shouldn't exist.
-test -f sub1/Makefile.in
-test ! -e sub2/Makefile.in
-test ! -e sub3/Makefile.in
-test ! -e sub4/Makefile.in
-test ! -e sub5/Makefile.in
-
-rm -f Makefile.in */Makefile.in
-
-: > sub2/Makefile.am
-: > sub3/Makefile.am
-
-AUTOMAKE_fails
-ls -l Makefile.in */Makefile.in || : # For debugging.
-test -f sub1/Makefile.in
-test -f sub2/Makefile.in
-test -f sub3/Makefile.in
-test ! -e sub4/Makefile.in
-test ! -e sub5/Makefile.in
-
-:
index f8b8636923c0a3b2ce23cb7277eb3528df2f0412..45beb4bede0a3fd853cf3a261d3b86865528180d 100755 (executable)
@@ -55,14 +55,9 @@ cat - libMakefile.am > libMakefile2.am << 'END'
 AUTOMAKE_OPTIONS = no-dependencies
 END
 
-# Make sure 'compile' is required.
-for m in $makefiles; do
-  AUTOMAKE_fails $m
-  $EGREP " required file.* '(compile|\./compile)'" stderr
-done
-
-: > compile
 $AUTOMAKE
+# Make sure 'compile' is required.
+test -f compile
 
 # Regression test for missing space.
 $FGREP ')-c' $makefiles && exit 1
index a3add40f96a566bdd297e3dbfbce67e5f5304f48..3b73165ad9cd48fa127c833c159ea8bbca6e46a4 100755 (executable)
@@ -39,10 +39,6 @@ python_PYTHON = in.py
 END
 
 $ACLOCAL
-
-AUTOMAKE_fails
-grep '^Makefile\.am:1:.* required file.*py-compile' stderr
-
 $AUTOMAKE -a
 grep '^py_compile *=' Makefile.in
 test -f py-compile