automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, branch-1.11, updated. v1.11


From: Ralf Wildenhues
Subject: [Automake-commit] [SCM] GNU Automake branch, branch-1.11, updated. v1.11.1-363-gce21508
Date: Sat, 09 Apr 2011 10:40:30 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=ce215083c43fb53a4aa123a1ea9a1a297d335e0b

The branch, branch-1.11 has been updated
       via  ce215083c43fb53a4aa123a1ea9a1a297d335e0b (commit)
       via  7953494a128593bf74d2849f488f593c4d4fea9c (commit)
       via  6a85bc48aa9691574053a153d79cc79cd28e311f (commit)
       via  d4df619bfa53ef0bd81fbbbe03b3672711defe2f (commit)
       via  e87c030d838a0c649239c9d2a632c1b2415852a0 (commit)
       via  0a6a45503a44d149da77e1b3b35aa16592c1a258 (commit)
       via  e72a1b007f3ae165ded1af8a00dce83448c2ff2c (commit)
       via  8d3571b9dddfcab822f7b62832070b2214a11ac9 (commit)
       via  1dd55a48e354e57686879ea9900c8daf0402a10a (commit)
      from  045e22a5195b72afebedebb0eb189abaeacf1ba7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ce215083c43fb53a4aa123a1ea9a1a297d335e0b
Merge: 045e22a 7953494
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Apr 9 12:38:46 2011 +0200

    Merge branch 'maint' into branch-1.11

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   67 ++++++++++++
 NEWS                                               |    2 +
 THANKS                                             |    2 +
 automake.in                                        |    9 ++
 doc/automake.texi                                  |    8 +-
 lib/depcomp                                        |   10 +-
 tests/Makefile.am                                  |    5 +
 tests/Makefile.in                                  |    5 +
 tests/aclocal6.test                                |   22 +----
 tests/check-exported-srcdir.test                   |    6 +-
 tests/depcomp9.test                                |   90 ++++++++++++++++
 .../{target-cflags.test => lex-subobj-nodep.test}  |   67 ++++++------
 tests/{maintclean.test => maintclean-vpath.test}   |   50 +++++++--
 tests/maintclean.test                              |   36 +++++--
 tests/pr8365-remake-timing.test                    |  110 ++++++++++++++++++++
 tests/subdir5.test                                 |   25 +++--
 tests/subdir8.test                                 |   23 ++--
 tests/yacc5.test                                   |   11 ++-
 18 files changed, 443 insertions(+), 105 deletions(-)
 create mode 100755 tests/depcomp9.test
 copy tests/{target-cflags.test => lex-subobj-nodep.test} (55%)
 copy tests/{maintclean.test => maintclean-vpath.test} (64%)
 create mode 100755 tests/pr8365-remake-timing.test

diff --git a/ChangeLog b/ChangeLog
index 77ecd5e..eb2e233 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,70 @@
+2011-04-09  Ralf Wildenhues  <address@hidden>
+
+       Clarify regex code in depcomp.
+       * lib/depcomp: Add comment why we don't need regex-escaping here.
+       Suggested by Stefano Lattarini.
+
+2011-04-08  Ralf Wildenhues  <address@hidden>
+
+       Fix makedepend depmode for VPATH builds.
+       * lib/depcomp [makedepend]: Remove any VPATH prefix from the
+       object file name, so a rebuild doesn't attempt to update the
+       .Po files in the source tree.
+       * tests/depcomp9.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+
+2011-04-02  Stefano Lattarini  <address@hidden>
+
+       tests: fix timestamp-related failures
+       Fixes automake bug#8365.
+       * tests/aclocal6.test: Sleep before modifying m4 files that should
+       trigger remake rules.  Remove incorrect/obsoleted comments.
+       * tests/subdir5.test: Likewise, and extend a bit.
+       * tests/subdir8.test: Likewise.
+       * tests/pr8365-remake-timing.test: New xfailing test.
+       * tests/Makefile.am (TESTS): Update.
+       Report from Sam Steingold.
+
+2011-04-02  Ralf Wildenhues  <address@hidden>
+
+       Create subdirs for generated sources even when not dep tracking.
+       * automake.in (handle_single_transform): If $object is derived
+       and lands in subdir, be sure to output a dirstamp dependency.
+       * tests/yacc5.test: Avoid falsely matching the dirstamp
+       dependency when grepping for a rule.
+       * tests/lex-subobj-nodep.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * THANKS: Update.
+       Report by Ignacy Gawedzki.
+
+       Fix locale issue in check-exported-srcdir.test.
+       * tests/check-exported-srcdir.test: Reformulate glob to not fail
+       in a locale that ignores or interleaves character case.
+
+2011-04-01  Stefano Lattarini  <address@hidden>
+
+       docs: better visibility for aclocal in the index
+       * doc/automake.texi (@menu): Rename title for entry 'configure'
+       from "Scanning configure.ac or configure.in" to the more precise
+       "Scanning configure.ac, using aclocal".
+       (@detailmenu): Adjust.
+       (@node configure): Adjust, and extend @cindex calls accordingly.
+       * THANKS: Update.
+       From a report by Maynard Johnson.
+
+2011-03-30  Stefano Lattarini  <address@hidden>
+
+       tests: improve tests on "maintainer-clean" target
+       * tests/aclocal6.test: Move checks related to "maintainer-clean"
+       functionalities into ...
+       * tests/maintclean-vpath.test: ... this new test.
+       * tests/maintclean.test: Update heading comments.  Extend to also
+       test subdirs.  Remove useless disabling of YACC.  Fix m4 quoting
+       in configure.in.  Add a trailing `:' command.  Remove extra blank
+       lines.
+       * tests/Makefile.am (TESTS): Update.
+
 2011-03-21  Ralf Wildenhues  <address@hidden>
 
        tests: fix unindent to use printf not echo for script.
diff --git a/NEWS b/NEWS
index 8a6ac29..9864090 100644
--- a/NEWS
+++ b/NEWS
@@ -55,6 +55,8 @@ Bugs fixed in 1.11.1a:
 
   - The parallel-tests driver now does not produce erroneous results
     with Tru64/OSF 5.1 sh upon unreadable log files any more.
+
+  - The makedepend depmode now works better with VPATH builds.
 
 Bugs fixed in 1.11.1:
 
diff --git a/THANKS b/THANKS
index 60af1ee..040da98 100644
--- a/THANKS
+++ b/THANKS
@@ -131,6 +131,7 @@ Harlan Stenn                address@hidden
 He Li                  address@hidden
 Henrik Frystyk Nielsen address@hidden
 Ian Lance Taylor       address@hidden
+Ignacy Gawedzki                address@hidden
 Илья Н. Голубев            address@hidden
 Imacat                 address@hidden
 Inoue                  address@hidden
@@ -223,6 +224,7 @@ Matthias Andree             address@hidden
 Matthias Clasen                address@hidden
 Matthias Klose         address@hidden
 Maxim Sinev            address@hidden
+Maynard Johnson                address@hidden
 Merijn de Jonge                address@hidden
 Michael Brantley       address@hidden
 Michael Ploujnikov     address@hidden
diff --git a/automake.in b/automake.in
index d56fbf7..d74730d 100755
--- a/automake.in
+++ b/automake.in
@@ -2053,6 +2053,15 @@ sub handle_single_transform ($$$$$%)
            # derived from is not.
            &push_dist_common ($object)
              unless ($topparent =~ /^(?:nobase_)?nodist_/);
+
+           # If resulting derived source is in a subdir, we need to make
+           # sure the subdir exists at build time.
+           if ($object =~ /\//)
+             {
+               my $dirstamp = require_build_directory_maybe ($object);
+               depend ($object, $dirstamp)
+                 if ($dirstamp);
+             }
            next;
          }
 
diff --git a/doc/automake.texi b/doc/automake.texi
index 4324616..d60ca50 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -102,7 +102,7 @@ section entitled ``GNU Free Documentation License.''
 * Generalities::                General ideas
 * Examples::                    Some example packages
 * Invoking Automake::           Creating a Makefile.in
-* configure::                   Scanning configure.ac or configure.in
+* configure::                   Scanning configure.ac, using aclocal
 * Directories::                 Declaring subdirectories
 * Programs::                    Building programs and libraries
 * Other Objects::               Other derived objects
@@ -175,7 +175,7 @@ Some example packages
 * Complete::                    A simple example, start to finish
 * true::                        Building true and false
 
-Scanning @file{configure.ac}
+Scanning @file{configure.ac}, using @command{aclocal}
 
 * Requirements::                Configuration requirements
 * Optional::                    Other things Automake recognizes
@@ -2691,10 +2691,12 @@ concurrently.  This is an experimental feature.
 
 
 @node configure
address@hidden Scanning @file{configure.ac}
address@hidden Scanning @file{configure.ac}, using @command{aclocal}
 
 @cindex @file{configure.ac}, scanning
 @cindex Scanning @file{configure.ac}
address@hidden Using @command{aclocal}
address@hidden @command{aclocal}, using
 
 Automake scans the package's @file{configure.ac} to determine certain
 information about the package.  Some @command{autoconf} macros are required
diff --git a/lib/depcomp b/lib/depcomp
index df8eea7..8097c19 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -1,10 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-04-09-11; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 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
@@ -503,7 +503,9 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
   sed '1,2d' "$tmpdepfile" | tr ' ' '
 ' | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4becdbb..c894864 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -21,6 +21,7 @@ all.test \
 auxdir2.test \
 cond17.test \
 gcj6.test \
+pr8365-remake-timing.test \
 txinfo5.test
 
 include $(srcdir)/parallel-tests.am
@@ -276,6 +277,7 @@ depcomp6.test \
 depcomp7.test \
 depcomp8a.test \
 depcomp8b.test \
+depcomp9.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -428,6 +430,7 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lex-subobj-nodep.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -489,6 +492,7 @@ ltorder.test \
 lzma.test \
 m4-inclusion.test \
 maintclean.test \
+maintclean-vpath.test \
 make.test \
 makej.test \
 makej2.test \
@@ -639,6 +643,7 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+pr8365-remake-timing.test \
 regex.test \
 req.test \
 reqd.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 559683e..ccd9ba4 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -277,6 +277,7 @@ all.test \
 auxdir2.test \
 cond17.test \
 gcj6.test \
+pr8365-remake-timing.test \
 txinfo5.test
 
 parallel_tests = \
@@ -546,6 +547,7 @@ depcomp6.test \
 depcomp7.test \
 depcomp8a.test \
 depcomp8b.test \
+depcomp9.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -698,6 +700,7 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lex-subobj-nodep.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -759,6 +762,7 @@ ltorder.test \
 lzma.test \
 m4-inclusion.test \
 maintclean.test \
+maintclean-vpath.test \
 make.test \
 makej.test \
 makej2.test \
@@ -909,6 +913,7 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+pr8365-remake-timing.test \
 regex.test \
 req.test \
 reqd.test \
diff --git a/tests/aclocal6.test b/tests/aclocal6.test
index ea6bac3..ddf9401 100755
--- a/tests/aclocal6.test
+++ b/tests/aclocal6.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
@@ -44,19 +44,14 @@ $ACLOCAL -I m4
 $AUTOCONF
 $AUTOMAKE --copy --add-missing
 
-# Users can disable autom4te.cache.
-if test -d autom4te.cache; then
-  test_cache='test -d'
-else
-  test_cache=:
-fi
-
 mkdir build
 cd build
 
 ../configure
 $MAKE
 
+# Modified configure dependencies must be newer than config.status.
+$sleep
 # Update an aclocal.m4 dependency, then make sure all Makefiles
 # are updated, even from a sub-directory.
 echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
@@ -79,15 +74,4 @@ test -f $me-1.0/m4/moredefs.m4
 test -f $me-1.0/m4/somedefs.m4
 test -f $me-1.0/acinclude.m4
 
-# Make sure maintainer-clean works in VPATH builds.
-# (This is unrelated to the rest of this test.)
-$MAKE clean
-$test_cache ../autom4te.cache
-test -f Makefile
-test -f sub/Makefile
-$MAKE maintainer-clean
-test ! -d ../autom4te.cache
-test ! -f Makefile
-test ! -f sub/Makefile
-
 :
diff --git a/tests/check-exported-srcdir.test b/tests/check-exported-srcdir.test
index dc02b22..5cec7fc 100755
--- a/tests/check-exported-srcdir.test
+++ b/tests/check-exported-srcdir.test
@@ -32,9 +32,9 @@ show_info ()
   fi
 }
 
-mkdir SrcDir BuildDir
-
-mv [a-z]* SrcDir
+mkdir SrcDir
+mv [!S]* SrcDir
+mkdir BuildDir
 cd SrcDir
 
 cat >> configure.in << 'END'
diff --git a/tests/depcomp9.test b/tests/depcomp9.test
new file mode 100755
index 0000000..d137fad
--- /dev/null
+++ b/tests/depcomp9.test
@@ -0,0 +1,90 @@
+#! /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/>.
+
+# makedepend should work in VPATH mode.
+
+# Here's the bug: makedepend will prefix VPATH to the object file name,
+# thus the second make will invoke depcomp with object='../../src/foo.o',
+# causing errors such as:
+# touch: cannot touch `../../src/.deps/foo.TPo': No such file or directory
+# makedepend: error:  cannot open "../../src/.deps/foo.TPo"
+# ../../depcomp: line 560: ../../src/.deps/foo.TPo: No such file or directory
+
+# We include subfoo only to be sure that we don't remove too much
+# from the object file name.
+
+required='makedepend'
+. ./defs || Exit 1
+
+mkdir src src/sub build
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_CONFIG_FILES([src/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = src
+END
+
+cat > src/Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c foo.h sub/subfoo.c
+END
+
+cat > src/foo.h <<EOF
+extern int subfoo (void);
+EOF
+
+cat >src/foo.c <<EOF
+#include "foo.h"
+int main (void)
+{
+  return subfoo ();
+}
+EOF
+
+cat >src/sub/subfoo.c <<EOF
+#include "foo.h"
+int subfoo (void)
+{
+  return 0;
+}
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cd build
+../configure am_cv_CC_dependencies_compiler_type=makedepend
+
+# Do not error out with the first make, as the forced 'makedepend'
+# depmode might not actually work, but we have overridden the
+# _AM_DEPENDENCIES tests.  The actual error only happens the second time
+# the objects are built, because 'makedepend' has silently messed up the
+# .Po files the first time.
+$MAKE || Exit 77
+$MAKE clean
+
+$MAKE >out 2>&1 || { cat out; Exit 1; }
+cat out
+grep 'src/[._]deps' out && Exit 1
+
+:
diff --git a/tests/target-cflags.test b/tests/lex-subobj-nodep.test
similarity index 55%
copy from tests/target-cflags.test
copy to tests/lex-subobj-nodep.test
index b324568..4449715 100755
--- a/tests/target-cflags.test
+++ b/tests/lex-subobj-nodep.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002, 2004, 2010 Free Software Foundation,
-# Inc.
+# 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
@@ -15,60 +14,60 @@
 # 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 to make sure target specific CFLAGS work
-# Assar Westerlund <address@hidden>
+# Ensure subdirs for subdir scanners are generated when subdir-objects
+# are used, even when dependency tracking is disabled.
 
-required=gcc
+required=flex
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(foo.c)
-AM_INIT_AUTOMAKE(target-cflags,0.0)
+set -e
+
+cat >>configure.in <<\END
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
+AC_PROG_LEX
+AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
-
-bin_PROGRAMS = foo bar
-foo_CFLAGS   = -DFOO
+cat >Makefile.am <<\END
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = p1 p2
+p1_SOURCES = sub1/s1.l
+p2_SOURCES = sub2/s2.l
+p2_CPPFLAGS = -DWHATEVER
 END
 
-cat > foo.c << 'END'
-#include <stdio.h>
-#ifdef FOO
-int main(void) {
+mkdir sub1 sub2
+
+cat >sub1/s1.l <<\END
+%%
+"END"   return EOF;
+.
+%%
+int main (void)
+{
+  while (yylex () != EOF)
+    ;
   return 0;
 }
-#endif
-END
 
-cat > bar.c << 'END'
-#ifndef FOO
-int main(void)
+int yywrap(void)
 {
   return 0;
 }
-#endif
 END
 
-set -e
+cp sub1/s1.l sub2/s2.l
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 mkdir build
-
 cd build
-../configure
+../configure --disable-dependency-tracking
+$MAKE sub1/s1.c
+$MAKE sub2/s2.c
+rm -rf sub1 sub2
 $MAKE
-./foo
-./bar
-cd ..
 
-./configure
-$MAKE
-./foo
-./bar
+:
diff --git a/tests/maintclean.test b/tests/maintclean-vpath.test
similarity index 64%
copy from tests/maintclean.test
copy to tests/maintclean-vpath.test
index a66464b..8dd2a95 100755
--- a/tests/maintclean.test
+++ b/tests/maintclean-vpath.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# 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
@@ -15,27 +15,36 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure distclean and maintainer-clean erase the right files.
+# This test is for VPATH builds; see sister test `maintclean-vpath.test'
+# for in-tree builds.
 
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_CONFIG_FILES(bar)
+AC_CONFIG_FILES([bar sub/Makefile])
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+SUBDIRS = sub
 noinst_DATA = foo.c
-
 foo.c:
        touch foo.c
-
 MAINTAINERCLEANFILES = foo.c
+END
 
+mkdir sub
+cat > sub/Makefile.am <<'END'
+noinst_SCRIPTS = zap
+zap: zap.sh
+       cp $(srcdir)/zap.sh $@ && chmod a+x $@
+MAINTAINERCLEANFILES = zap
 END
 
-touch bar.in
+: > bar.in
+: > sub/zap.sh
 
 $ACLOCAL
 $AUTOCONF
@@ -43,34 +52,55 @@ $AUTOMAKE
 
 # Users can disable autom4te.cache.
 if test -d autom4te.cache; then
-  test_cache='test -d autom4te.cache'
+  test_cache='test -d ../autom4te.cache'
 else
   test_cache=:
 fi
 
-# Since we don't require Yacc, make sure it's not used.
-./configure YACC=false
+mkdir build
+
+chmod a-w . sub
+
+cd build
+
+../configure
 test -f bar
 
 $MAKE
 test -f foo.c
+test -f sub/zap
+$test_cache
 
 $MAKE distclean
 test ! -f bar
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
 test -f foo.c
+test -f sub/zap
+test -f ../sub/zap.sh
 $test_cache
 
-./configure
+../configure
 test -f bar
 
 $MAKE foo.c
 test -f foo.c
+cd sub
+$MAKE zap
+test -f zap
+cd ..
+
+chmod u+w ..
 
 $MAKE maintainer-clean
+test -f ../sub/zap.sh
 test ! -f bar
 test ! -f foo.c
+test ! -f sub/zap
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
-test ! -d autom4te.cache
+test ! -d ../autom4te.cache
+
+:
diff --git a/tests/maintclean.test b/tests/maintclean.test
index a66464b..9e22463 100755
--- a/tests/maintclean.test
+++ b/tests/maintclean.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 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
@@ -15,27 +15,36 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure distclean and maintainer-clean erase the right files.
+# This test is for in-tree builds; see sister test `maintclean-vpath.test'
+# for VPATH builds.
 
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_CONFIG_FILES(bar)
+AC_CONFIG_FILES([bar sub/Makefile])
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+SUBDIRS = sub
 noinst_DATA = foo.c
-
 foo.c:
        touch foo.c
-
 MAINTAINERCLEANFILES = foo.c
+END
 
+mkdir sub
+cat > sub/Makefile.am <<'END'
+noinst_SCRIPTS = zap
+zap: zap.sh
+       cp $(srcdir)/zap.sh $@ && chmod a+x $@
+MAINTAINERCLEANFILES = zap
 END
 
-touch bar.in
+: > bar.in
+: > sub/zap.sh
 
 $ACLOCAL
 $AUTOCONF
@@ -48,18 +57,22 @@ else
   test_cache=:
 fi
 
-# Since we don't require Yacc, make sure it's not used.
-./configure YACC=false
+./configure
 test -f bar
 
 $MAKE
 test -f foo.c
+test -f sub/zap
+$test_cache
 
 $MAKE distclean
 test ! -f bar
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
 test -f foo.c
+test -f sub/zap
+test -f sub/zap.sh
 $test_cache
 
 ./configure
@@ -67,10 +80,19 @@ test -f bar
 
 $MAKE foo.c
 test -f foo.c
+cd sub
+$MAKE zap
+test -f zap
+cd ..
 
 $MAKE maintainer-clean
+test -f sub/zap.sh
 test ! -f bar
 test ! -f foo.c
+test ! -f sub/zap
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
 test ! -d autom4te.cache
+
+:
diff --git a/tests/pr8365-remake-timing.test b/tests/pr8365-remake-timing.test
new file mode 100755
index 0000000..079b0c0
--- /dev/null
+++ b/tests/pr8365-remake-timing.test
@@ -0,0 +1,110 @@
+#! /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/>.
+
+# Test for automake bug#8365, related to Makefile remake rules.
+# The bug is due to subtle timestamp issues and limitations in
+# make's behaviour, and is very unlikely to be triggered (we have
+# to resort to timestamp edit hacks to consistently expose it); in
+# any account, it is nigh to impossible to trigger it by running
+# make by hand.  Thus, fixing it would not be worth the hassle, but
+# we prefer to keep it exposed anyway.
+
+. ./defs || Exit 1
+
+set -e
+
+# We'll use calls to stat to get debugging information.
+if stat /dev/null; then stat=stat; else stat=:; fi
+
+cat >> configure.in << 'END'
+FOOBAR=zardoz
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+$ACLOCAL
+# Run automake *before* autoconf, because we want to ensure that
+# Makefile.in is not newer than configure.
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE Makefile
+$EGREP 'FOOBAR|zardoz' Makefile && Exit 99 # Sanity check.
+
+echo 'AC_SUBST([FOOBAR])' >> configure.in
+
+# Modified configure dependencies must have the same timestamp of
+# config.status and Makefile in order to trigger the bug.
+# We also re-touch config.status, because "touch -r" can truncate
+# timestamps on file systems with sub-second resolutions (see the
+# autoconf manual).  Finally, we also sleep before touching, to ensure
+# that the (possibly truncated) timestamps of config.status etc. are
+# strictly newer than the non-truncated configure timestamp.
+$stat config.status Makefile configure.in
+$sleep
+touch config.status
+touch -r config.status config.status Makefile configure.in
+$stat config.status Makefile configure.in
+
+# Also, the race condition is triggered only when aclocal, automake
+# and aclocal run fast enough to keep the timestamp of the generated
+# aclocal.m4, Makefile.in and configure equal to the timestamp of
+# Makefile & config.status.  To reproduce this race consistently, we
+# need the following hackish wrappers.
+
+save_AUTOCONF=$AUTOCONF
+
+cat > aclocal-wrap <<END
+#!/bin/sh
+set -ex
+# aclocal shouldn't use our autoconf wrapper when extracting
+# the races from configure.in.
+AUTOCONF='$save_AUTOCONF'; export AUTOCONF
+$ACLOCAL "\$@"
+touch -r config.status aclocal.m4
+$stat aclocal.m4
+END
+
+cat > automake-wrap <<END
+#!/bin/sh
+set -ex
+# automake shouldn't use our autoconf wrapper when extracting
+# the races from configure.in.
+AUTOCONF='$save_AUTOCONF'; export AUTOCONF
+$AUTOMAKE "\$@"
+touch -r config.status Makefile.in
+$stat Makefile.in
+END
+
+cat > autoconf-wrap <<END
+#!/bin/sh
+set -ex
+$AUTOCONF "\$@"
+touch -r config.status configure
+$stat configure
+END
+
+chmod a+x aclocal-wrap automake-wrap autoconf-wrap
+
+env \
+  ACLOCAL=./aclocal-wrap AUTOMAKE=./automake-wrap AUTOCONF=./autoconf-wrap \
+  $MAKE -e Makefile
+grep '^FOOBAR =' Makefile.in
+grep '^FOOBAR *= *zardoz *$' Makefile
+
+:
diff --git a/tests/subdir5.test b/tests/subdir5.test
index 5633ac6..3f4dfa3 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -55,18 +55,14 @@ $AUTOMAKE --include-deps --copy --add-missing
 $MAKE
 
 # Now add new directories.
-#
-# We shouldn't need to $sleep here: configure ensures that files
-# generated by it are newer than configure.  Thus, even if
-# Makefile.in is newer than configure but the updated Makefile.am
-# below has the same timestamp as Makefile.in, the latter should
-# be rebuilt due to its dependency on configure.in.
 
 # First we add a new directory by modifying configure.in directly.
 # We update configure.in *before* updating sub/Makefile.am; subdir8.test
 # does it in the other way: it updates confiles.m4 (which is m4_included
 # by configure.in there) after Makefile.am.
 
+# Modified configure dependencies must be newer than config.status.
+$sleep
 sed <configure.in >configure.tmp -e '/^AC_OUTPUT$/i\
 AC_CONFIG_FILES([maude/Makefile])\
 m4_include([confile.m4])\
@@ -89,11 +85,15 @@ echo 'SUBDIRS = maude' >> Makefile.am
 
 # We want a simple rebuild to create maude/Makefile automatically.
 $MAKE
+grep '^SUBDIRS = *maude *$' Makefile.in
+grep '^SUBDIRS = *maude *$' Makefile
 test -f maude/Makefile
 
 # Then we add a new directory by modifying a file included (through
 # `m4_include') by configure.in.
 mkdir maude2
+# Modified configure dependencies must be newer than config.status.
+$sleep
 cat >> confile.m4 << 'END'
 AC_CONFIG_FILES([maude2/Makefile])
 AC_SUBST([GREPME])
@@ -104,8 +104,13 @@ echo 'SUBDIRS += maude2' >> Makefile.am
 # We want a simple rebuild to create maude2/Makefile and update
 # all other Makefiles automatically.
 $MAKE
-grep '^GREPME =' Makefile
-grep '^GREPME =' maude/Makefile
-grep '^GREPME =' maude2/Makefile
+grep '^SUBDIRS =.* maude2' Makefile.in
+grep '^SUBDIRS =.* maude2' Makefile
+
+for ext in '.in' ''; do
+  for d in . maude maude2; do
+    grep '^GREPME =' $d/Makefile$ext
+  done
+done
 
 :
diff --git a/tests/subdir8.test b/tests/subdir8.test
index 093fac8..b39dfe4 100755
--- a/tests/subdir8.test
+++ b/tests/subdir8.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2009, 2010, 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
@@ -68,12 +69,6 @@ $AUTOMAKE --copy --add-missing
 $MAKE
 
 # Now add new directories.
-#
-# We shouldn't need to $sleep here: configure ensures that files
-# generated by it are newer than configure.  Thus, even if
-# Makefile.in is newer than configure but the updated Makefile.am
-# below has the same timestamp as Makefile.in, the latter should
-# be rebuilt due to its dependency on configure.in.
 
 # The first step users typically do when adding a new subdir is
 # editing configure.in.  That is already tested by subdir5.test,
@@ -94,6 +89,9 @@ mkdir maude
 
 # Update confiles.m4 *after* updating sub/Makefile.am; subdir5.test do
 # it in the other way: it updates configure.in before Makefile.am.
+# We sleep here because modified configure dependencies must be newer
+# than config.status.
+$sleep
 echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' >> confiles.m4
 
 # We want a simple rebuild from sub/ to create sub/maude/Makefile
@@ -101,6 +99,8 @@ echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' 
>> confiles.m4
 cd sub
 $MAKE
 cd ..
+grep '^SUBDIRS = *maude *$' sub/Makefile.in
+grep '^SUBDIRS = *maude *$' sub/Makefile
 test -f maude/Makefile
 test -f sub/maude/Makefile
 
@@ -109,9 +109,10 @@ test -f sub/maude/Makefile
 echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
 $MAKE
 
-grep '^GREPME =' Makefile
-grep '^GREPME =' maude/Makefile
-grep '^GREPME =' sub/Makefile
-grep '^GREPME =' sub/maude/Makefile
+for ext in '.in' ''; do
+  for d in . maude sub sub/maude; do
+    grep '^GREPME =' $d/Makefile$ext
+  done
+done
 
 :
diff --git a/tests/yacc5.test b/tests/yacc5.test
index 8b00ed8..f428396 100755
--- a/tests/yacc5.test
+++ b/tests/yacc5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 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
@@ -42,7 +42,7 @@ mkdir sub
 $ACLOCAL
 $AUTOMAKE -a
 
-grep '^maude\.c:' Makefile.in
+grep '^maude\.c:.*maude\.y' Makefile.in
 
 
 ## Try again with subdir-objects.
@@ -56,8 +56,9 @@ END
 $ACLOCAL
 $AUTOMAKE -a
 
-# No rule needed, the default .y.c: inference rule is enough.
-grep '^sub/maude\.c:' Makefile.in && Exit 1
+# No rule needed, the default .y.c: inference rule is enough
+# (but there may be an additional dependency on a dirstamp file).
+grep '^sub/maude\.c:.*maude\.y' Makefile.in && Exit 1
 
 
 ## Try again with per-exe flags.
@@ -80,3 +81,5 @@ grep 'maudec' Makefile.in && Exit 1
 
 # Make sure the .o file is required.
 grep '^am_maude_OBJECTS.*maude' Makefile.in
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]