This change simplifies the automake internals dealing with the
checking, copying and distributing of required auxiliary files.
With this change, a required auxiliary file is *unconditionally*
added to the contents of the DIST_COMMON variable in the generated
Makefile.in, before checking whether it exists, or trying to copy
it (if `--add-missing' is in use). This shouldn't be a problem,
since if the checking or copying of the file fails, automake will
bail out, the Makefile.in won't be created, and thus its content
will not matter. OK, this is not completely true when threaded
automake is in use, but then, such a situation was also possible
before this patch, so no regression here, which is enough for us.
This change is the first of a series of steps aimed at fixing
the regression introduced in threaded automake usage by commit
`
v1.11-1219-g326ecba'.
* automake.in (require_file_internal): Add the required file to
DIST_COMMON unconditionally.
* tests/missing-auxfile-stops-makefiles-creation.test: New test.
* tests/Makefile.am (TESTS): Add it.
+2011-10-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ dist: separate auxiliary file instantiation from DIST_COMMON update
+ This change simplifies the automake internals dealing with the
+ checking, copying and distributing of required auxiliary files.
+ With this change, a required auxiliary file is *unconditionally*
+ added to the contents of the DIST_COMMON variable in the generated
+ Makefile.in, before checking whether it exists, or trying to copy
+ it (if `--add-missing' is in use). This shouldn't be a problem,
+ since if the checking or copying of the file fails, automake will
+ bail out, the Makefile.in won't be created, and thus its content
+ will not matter. OK, this is not completely true when threaded
+ automake is in use, but then, such a situation was also possible
+ before this patch, so no regression here, which is enough for us.
+ This change is the first of a series of steps aimed at fixing
+ the regression introduced in threaded automake usage by commit
+ `v1.11-1219-g326ecba'.
+ * automake.in (require_file_internal): Add the required file to
+ DIST_COMMON unconditionally.
+ * tests/missing-auxfile-stops-makefiles-creation.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+
2011-10-08 Stefano Lattarini <stefano.lattarini@gmail.com>
refactor: rename a subroutine to a more proper name
foreach my $file (@files)
{
+ next
+ unless $strictness >= $mystrict;
+
my $fullfile = "$dir/$file";
my $found_it = 0;
my $dangling_sym = 0;
+ push_required_file ($dir, $file, $fullfile);
+
if (-l $fullfile && ! -f $fullfile)
{
$dangling_sym = 1;
elsif (dir_has_case_matching_file ($dir, $file))
{
$found_it = 1;
- push_required_file ($dir, $file, $fullfile);
}
# `--force-missing' only has an effect if `--add-missing' is
next if defined $required_file_not_found{$fullfile};
$required_file_not_found{$fullfile} = 1;
}
-
- if ($strictness >= $mystrict)
- {
+ # FIXME: re-indent this correctly
if ($dangling_sym && $add_missing)
{
unlink ($fullfile);
}
set_dir_cache_file ($dir, $file);
}
- push_required_file ($dir, $file, $fullfile);
}
else
{
if !$suppress && rule $file;
msg ($suppress ? 'note' : 'error', $where, "$message$trailer$trailer2");
- }
}
}
}
missing4.test \
missing5.test \
missing6.test \
+missing-auxfile-stops-makefiles-creation.test \
mkinstall.test \
mkinst2.test \
mkinst3.test \
missing4.test \
missing5.test \
missing6.test \
+missing-auxfile-stops-makefiles-creation.test \
mkinstall.test \
mkinst2.test \
mkinst3.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 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.in <<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.in
+ 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 ! -f sub2/Makefile.in
+test ! -f sub3/Makefile.in
+test ! -f sub4/Makefile.in
+test ! -f 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 ! -f sub4/Makefile.in
+test ! -f sub5/Makefile.in
+
+: