From: Stefano Lattarini Date: Fri, 7 Oct 2011 18:53:08 +0000 (+0200) Subject: dist: separate auxiliary file instantiation from DIST_COMMON update X-Git-Tag: ng-0.5a~89^2~27^2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7318775d14414207c3254775b4d1232cf09e602b;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index aff4d068d..3660fbb5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2011-10-08 Stefano Lattarini + + 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 refactor: rename a subroutine to a more proper name diff --git a/automake.in b/automake.in index 951d5c7c0..9d51b8d45 100644 --- a/automake.in +++ b/automake.in @@ -7676,10 +7676,15 @@ sub require_file_internal ($$$@) 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; @@ -7687,7 +7692,6 @@ sub require_file_internal ($$$@) 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 @@ -7708,9 +7712,7 @@ sub require_file_internal ($$$@) 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); @@ -7763,7 +7765,6 @@ sub require_file_internal ($$$@) } set_dir_cache_file ($dir, $file); } - push_required_file ($dir, $file, $fullfile); } else { @@ -7783,7 +7784,6 @@ sub require_file_internal ($$$@) if !$suppress && rule $file; msg ($suppress ? 'note' : 'error', $where, "$message$trailer$trailer2"); - } } } } diff --git a/tests/Makefile.am b/tests/Makefile.am index dd07247ff..8980a6bc7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -681,6 +681,7 @@ missing3.test \ missing4.test \ missing5.test \ missing6.test \ +missing-auxfile-stops-makefiles-creation.test \ mkinstall.test \ mkinst2.test \ mkinst3.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index ecd4bcc7e..32dac78a4 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -945,6 +945,7 @@ missing3.test \ missing4.test \ missing5.test \ missing6.test \ +missing-auxfile-stops-makefiles-creation.test \ mkinstall.test \ mkinst2.test \ mkinst3.test \ diff --git a/tests/missing-auxfile-stops-makefiles-creation.test b/tests/missing-auxfile-stops-makefiles-creation.test new file mode 100755 index 000000000..6492a149f --- /dev/null +++ b/tests/missing-auxfile-stops-makefiles-creation.test @@ -0,0 +1,65 @@ +#! /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 . + +# 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 < 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 + +: