From d4afc1bb5338daacbaf8eb4767241bab5a1b28f9 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 23 Jul 2002 18:58:07 +0000 Subject: [PATCH] * tests/required2.test: New file. * tests/Makefile.am (TESTS): Add required2.test. * automake.in (initialize_per_input): Remove %require_file_found setting. This reverts my change of 2002-04-19. (require_file_internal): Use the full name of a file as a key in %require_file_found, not only the basename. Reported by Andrew Suffield. --- ChangeLog | 10 ++++++++++ THANKS | 1 + automake.in | 16 +++++++--------- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/required2.test | 44 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 64 insertions(+), 9 deletions(-) create mode 100755 tests/required2.test diff --git a/ChangeLog b/ChangeLog index 0fd6cdde..bbf4b435 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-07-23 Alexandre Duret-Lutz + + * tests/required2.test: New file. + * tests/Makefile.am (TESTS): Add required2.test. + * automake.in (initialize_per_input): Remove %require_file_found + setting. This reverts my change of 2002-04-19. + (require_file_internal): Use the full name of a file as a + key in %require_file_found, not only the basename. + Reported by Andrew Suffield. + 2002-07-22 Alexandre Duret-Lutz * automake.in (handle_subdirs): Warn if `obj' appears in SUBDIRS. diff --git a/THANKS b/THANKS index 83a70194..094ccd6e 100644 --- a/THANKS +++ b/THANKS @@ -14,6 +14,7 @@ Alexey Mahotkin alexm@hsys.msk.ru Andreas Buening andreas.buening@nexgo.de Andreas Schwab schwab@suse.de Andrew Cagney cagney@tpgi.com.au +Andrew Suffield asuffield@debian.org Andris Pavenis pavenis@lanet.lv Angus Leeming a.leeming@ic.ac.uk Anthony Green green@cygnus.com diff --git a/automake.in b/automake.in index 2fee6e38..b771965c 100755 --- a/automake.in +++ b/automake.in @@ -460,6 +460,11 @@ my $global_options = ''; # Same as $suffix_rules (declared below), but records only the # default rules supplied by the languages Automake supports. my $suffix_rules_default; + +# If a file name appears as a key in this hash, then it has already +# been checked for. This variable is local to the "require file" +# functions. +my %require_file_found = (); ################################################################ @@ -665,11 +670,6 @@ my @substfroms; # force. my @substtos; -# If a file name appears as a key in this hash, then it has already -# been checked for. This variable is local to the "require file" -# functions. -my %require_file_found = (); - # This keeps track of all variables defined by subobjname. # The value stored is the variable names. # The key has the form "(COND1)VAL1(COND2)VAL2..." where VAL1 and VAL2 @@ -833,8 +833,6 @@ sub initialize_per_input () # We always include `.'. This isn't strictly correct. %libtool_clean_directories = ('.' => 1); - %require_file_found = (); - %subobjvar = (); %appendvar = (); @@ -8348,8 +8346,8 @@ sub require_file_internal ($$@) # DIST_COMMON. if (! $found_it) { - next if defined $require_file_found{$file}; - $require_file_found{$file} = 1; + next if defined $require_file_found{$fullfile}; + $require_file_found{$fullfile} = 1; } if ($strictness >= $mystrict) diff --git a/tests/Makefile.am b/tests/Makefile.am index 61b24662..90be8805 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -309,6 +309,7 @@ remake2.test \ remake3.test \ req.test \ required.test \ +required2.test \ rulepat.test \ scripts.test \ seenc.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 3d6abff4..b593d0d4 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -397,6 +397,7 @@ remake2.test \ remake3.test \ req.test \ required.test \ +required2.test \ rulepat.test \ scripts.test \ seenc.test \ diff --git a/tests/required2.test b/tests/required2.test new file mode 100755 index 00000000..6493681b --- /dev/null +++ b/tests/required2.test @@ -0,0 +1,44 @@ +#! /bin/sh + +# Regression test for a bug reported by Andrew Suffield. +# (Automake goes wild and try to rerun itself more than two time +# to fix the Makefiles.) + +required='libtoolize' +. $srcdir/defs || exit 1 + +set -e + +cat >>configure.in <<'END' +AC_CONFIG_AUX_DIR([autoconf]) +AC_PROG_CC +AM_PROG_LIBTOOL +AC_CONFIG_FILES([autoconf/Makefile main/Makefile]) +AC_OUTPUT +END + +mkdir autoconf +mkdir main + +: > autoconf/Makefile.am +echo 'SUBDIRS = autoconf main' >Makefile.am + +cat >main/Makefile.am <<'END' +lib_LTLIBRARIES = lib0.la +lib0_la_SOURCES = 0.c +END + +libtoolize --force --copy +$ACLOCAL +$AUTOCONF + +test -f autoconf/ltmain.sh # Sanity check. +rm -f autoconf/ltmain.sh +$AUTOMAKE --add-missing --copy 2>stderr +cat stderr +grep 'running more than two' stderr && exit 1 + +# Since we are ensuring that 'running more than two' is not printed, +# also ensure that it can be printed. This way if someone changes the +# wording of this message (s)he will remember to adjust this test. +grep 'running more than two' ../../automake -- 2.43.5