automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.2


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.2-532-ge11cbc0
Date: Mon, 16 Jul 2012 10:14:50 +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=e11cbc098858b0e37cad641d991b93bf976cd1f8

The branch, ng/master has been updated
       via  e11cbc098858b0e37cad641d991b93bf976cd1f8 (commit)
       via  de7c0bcfdee56ba7e56b10b979aab11b7f71814b (commit)
       via  c38a39baa41230085dbe5b135055e4bef13267b9 (commit)
       via  094b83a641e3b5b4aedf8820cb2af9d1c32cb476 (commit)
       via  455437e864ee89f3e09b2d18a7215a79291925d1 (commit)
       via  ec5cb49bf553a4823bd52bcf012df59b7b4ebb51 (commit)
       via  eef78e2c35ec51b607e767d544770d57c587c06d (commit)
       via  6e3c0b92fdef5119ea2ca508061a9b46ef4c251b (commit)
       via  c08068901f025912c8bd442f9e167546b8805753 (commit)
       via  b67f8fde3a8052881dfa78b3b04d5b917b750a7f (commit)
       via  aad12dcc668dfdfdb193e4e734ceb7235ea6edfc (commit)
       via  ae387d32c1ae8173cffb5019bf6db12a4de0177c (commit)
       via  fa10457919d195957bae104cce6be8ccebd53347 (commit)
       via  4ce3d13166d90a8be9f00b66c9e3a8275cd0d0ac (commit)
       via  cfda11fb768888fb2802e265ed8d5438cef2f123 (commit)
       via  9a6a600138d30d36e02d186625cc3932d4624aec (commit)
       via  9404f529bc178d75ee8003853e1fa67281cd080d (commit)
       via  7e31ff5cb4b744454774c73032e95bba0a481506 (commit)
       via  0a25f35b5d0a4d2acb5a72f25cf25ecc0d8e84dd (commit)
       via  be2bb639757a723d44809678d0c21cd429a321cd (commit)
       via  1a871ca02705c1225a75bb024119efbf56ab19c4 (commit)
       via  4294cbb03034099f59238eee28accabf790866d0 (commit)
       via  7eccbf44fcee432c20ccd95b384f1c3494e4712c (commit)
       via  19d4b87d970e316a7e13c8895ed0ffe62df5f00e (commit)
       via  312c7dcbd349f86574f835debdd619314341d0ee (commit)
       via  5dd21f9af052cfd2fa3dddb7f2ff4c5f7437a657 (commit)
       via  9df354ac9834f319c1faeef11748b7f1f7afdfae (commit)
       via  7cea4b0ad0824dfbff37b84796a4255cf46f0c55 (commit)
       via  4a22c5a0184a7871ea9cd5225b896b6f51254b63 (commit)
       via  5442fb372227b460a6927efe6180a777b530dcf8 (commit)
       via  1bc5acb2df2fdf297bc101f36589ab9f932647bf (commit)
       via  65e7ac8c3556d1895ee597811856710143cfc4ac (commit)
       via  cf80959825ac3b18271d0c15ce7345e64410c2f0 (commit)
      from  90230640b6347c8c709a2e983aa15ae98c3dfaa9 (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 e11cbc098858b0e37cad641d991b93bf976cd1f8
Merge: de7c0bc 7cea4b0
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jul 16 11:49:15 2012 +0200

    Merge branch 'ng/dist-many' into ng/master
    
    * ng/dist-many:
      [ng] dist: do not exceed command line length limits, even with many files
      [ng] coverage: distributing lots of files
      [ng] dist: memoize some internal variables

commit de7c0bcfdee56ba7e56b10b979aab11b7f71814b
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jul 16 11:39:53 2012 +0200

    [ng] fixup: tests on Bison skeletons are now passing
    
    * Makefile.am (XFAIL_TESTS): So remove them from here.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit c38a39baa41230085dbe5b135055e4bef13267b9
Merge: 9023064 094b83a
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jul 16 11:27:35 2012 +0200

    Merge branch 'master' into ng/master
    
    * master: (23 commits)
      fixup: delete "# serial" line in m4/amversion.in
      news: update about recent ylwrap changes and fixes
      m4: get rid of "# serial" lines
      configure: ${#param} must be supported by the shell for the testsuite
      yacc tests: fix a spurious failure with parallel make
      ylwrap: use proper quoting inside a `...` substitution
      ylwrap: don't uselessly reset the exit status in case of failure
      ylwrap: fix C++ support for Bison
      ylwrap: refactor: move loop invariant
      ylwrap: refactoring: don't rely on the file order
      tests: upgrade and fix Bison test case
      tests: fix bison input file
      ylwrap: comment changes
      ylwrap: modernize idioms
      ylwrap: rename header inclusion in generated parsers
      ylwrap: simplify the list of renamings
      ylwrap: refactor: less duplication
      news: mention fixed testsuite weaknesses
      news: bump, for future 1.12.3
      tests: verify the shell test scripts are syntactically valid
      tests: don't use C instead of C++ compiler on case-insensitive platforms
      tests: avoid spurious TAP errors on Mac OS X 10.7
      tests: fix spurious failure in aclocal7.sh on fast machines
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 7cea4b0ad0824dfbff37b84796a4255cf46f0c55
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jul 13 10:32:33 2012 +0200

    [ng] dist: do not exceed command line length limits, even with many files
    
    * lib/am/distdir.am (am.mkdir-for-dist, am.write-list-of-distfiles): New
    internal functions.
    (distdir): Using them and the 'am.xargs-map' function, in a way that
    should prevent failures due to excessive command line lengths.
    
    With this, the tests 'dist-many.sh' and 'dist-many2.sh' pass on the
    systems where we verified they were previously failing.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 4a22c5a0184a7871ea9cd5225b896b6f51254b63
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jul 13 00:49:39 2012 +0200

    [ng] coverage: distributing lots of files
    
    * t/dist-many.sh: New test, try distributing ~ 30 thousands files.
    Currently fails on several systems (e.g., Linux 2.6.30 on i686,
    Solaris 10 on i86pc).
    * t/dist-many2.sh: New test, check that our distribution rules do not
    hit errors due to an exceeded command line length when there are
    many files to distribute; it does so by faking  a very low command
    line length limit for 'mkdir' (max 50 arguments) and the shell (max
    4000 characters).  Currently failing.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 5442fb372227b460a6927efe6180a777b530dcf8
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jul 12 15:58:25 2012 +0200

    [ng] dist: memoize some internal variables
    
    * lib/am/distdir.am: Here, so that we will be able to use them several
    times with no performance impact.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

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

Summary of changes:
 Makefile.am                  |   37 +++++++++-
 NEWS                         |   28 +++++++-
 THANKS                       |    2 +
 configure.ac                 |   21 +++++-
 lib/am/distdir.am            |   40 ++++++----
 lib/ylwrap                   |  172 ++++++++++++++++++++++--------------------
 m4/amversion.in              |    2 -
 m4/amversion.m4              |    2 -
 m4/ar-lib.m4                 |    2 -
 m4/as.m4                     |    2 -
 m4/auxdir.m4                 |    2 -
 m4/cond-if.m4                |    3 -
 m4/cond.m4                   |    2 -
 m4/depend.m4                 |    1 -
 m4/dmalloc.m4                |    2 -
 m4/gcj.m4                    |    2 -
 m4/init.m4                   |    2 -
 m4/install-sh.m4             |    2 -
 m4/lex.m4                    |    2 -
 m4/lispdir.m4                |    2 -
 m4/maintainer.m4             |    2 -
 m4/minuso.m4                 |    2 -
 m4/missing.m4                |    3 -
 m4/options.m4                |    2 -
 m4/protos.m4                 |    2 -
 m4/python.m4                 |    1 -
 m4/runlog.m4                 |    2 -
 m4/sanity.m4                 |    2 -
 m4/silent.m4                 |    2 -
 m4/strip.m4                  |    2 -
 m4/substnot.m4               |    2 -
 m4/tar.m4                    |    2 -
 m4/upc.m4                    |    2 -
 m4/vala.m4                   |    2 -
 t/aclocal7.sh                |    5 +
 t/dist-many.sh               |   82 ++++++++++++++++++++
 t/dist-many2.sh              |  119 +++++++++++++++++++++++++++++
 t/self-check-exit.tap        |    8 +--
 t/yacc-bison-skeleton-cxx.sh |   20 +++--
 t/yacc-bison-skeleton.sh     |    8 ++-
 t/yacc-d-basic.sh            |    9 ++-
 41 files changed, 433 insertions(+), 174 deletions(-)
 create mode 100755 t/dist-many.sh
 create mode 100755 t/dist-many2.sh

diff --git a/Makefile.am b/Makefile.am
index e0c1042..290d5f4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -340,8 +340,6 @@ perl_fake_XFAIL_TESTS = \
 XFAIL_TESTS = \
   t/all.sh \
   t/override-suggest-local.sh \
-  t/yacc-bison-skeleton-cxx.sh \
-  t/yacc-bison-skeleton.sh \
   t/comments-in-var-def.sh \
   t/cond17.sh \
   t/dist-srcdir2.sh \
@@ -436,6 +434,41 @@ check-no-repeated-test-name:
 check-local: check-no-repeated-test-name
 .PHONY: check-no-repeated-test-name
 
+# Check that our test cases are syntactically correct.
+# See automake bug#11898.
+check-tests-syntax:
+       @st=0; \
+       err () { echo "$@: $$*" >&2; st=1; }; \
+## The user might do something like "make check TESTS=t/foo" or
+## "make check TESTS_LOGS=t/foo.log" and expect (say) the test
+## 't/foo.sh' to be run; this has worked well until today, and
+## we want to continue supporting this use case.
+       bases=`for log in : $(TEST_LOGS); do echo $$log; done \
+         | sed -e '/^:$$/d' -e 's/\.log$$//'`; \
+       for bas in $$bases; do \
+         for suf in sh tap pl; do \
+           tst=$$bas.$$suf; \
+## Emulate VPATH search.
+           if test -f $$tst; then \
+             break; \
+           elif test -f $(srcdir)/$$tst; then \
+             tst=$(srcdir)/$$tst; \
+             break; \
+           else \
+             tst=''; \
+           fi; \
+         done; \
+         test -n "$$tst" || err "couldn't find test '$$bas'"; \
+## Don't check that perl tests are valid shell scripts!
+         test $$suf = pl && continue; \
+         $(AM_V_P) && echo " $(AM_TEST_RUNNER_SHELL) -n $$tst"; \
+         $(AM_TEST_RUNNER_SHELL) -n "$$tst" \
+           || err "test '$$tst' syntactically invalid"; \
+       done; \
+       exit $$st
+check-local: check-tests-syntax
+.PHONY: check-tests-syntax
+
 # Run the testsuite with the installed aclocal and automake.
 installcheck-local: installcheck-testsuite
 installcheck-testsuite:
diff --git a/NEWS b/NEWS
index c5ea50f..6c39a7d 100644
--- a/NEWS
+++ b/NEWS
@@ -104,7 +104,7 @@ New in 1.13:
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-New in 1.12.2:
+New in 1.12.3:
 
 * WARNING: Future backward-incompatibilities!
 
@@ -139,6 +139,32 @@ New in 1.12.2:
     giving more useful warnings than a bare "command not found" from a
     make recipe would.
 
+* M4 files:
+
+  - The '.m4' files provided by Automake does not define serial numbers
+    anymore.  This should cause no difference in the behaviour of aclocal
+    though.
+
+* Automake Testsuite:
+
+  - Some testsuite weaknesses and spurious failures have been fixed.
+
+* Long-standing bugs:
+
+  - Instead of renaming only self-references of files (typically for
+    #lines), ylwrap now also renames references to the other generated
+    files.  This fixes support for GLR and C++ parsers from Bison (PR
+    automake/491 and automake bug#7648): 'parser.c' now properly
+    #includes 'parser.h' instead of 'y.tab.h'.
+
+  - Generated files unknown to ylwrap are now preserved.  This fixes
+    C++ support for Bison (automake bug#7648): location.hh and the
+    like are no longer discarded.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+New in 1.12.2:
+
 * Warnings and deprecations:
 
   - Automake now issues a warning (in the 'portability' category) if
diff --git a/THANKS b/THANKS
index 01b78c1..ca95db8 100644
--- a/THANKS
+++ b/THANKS
@@ -150,6 +150,7 @@ Imacat                          address@hidden
 Inoue                           address@hidden
 Jack Kelly                      address@hidden
 James Amundson                  address@hidden
+James Bostock                   address@hidden
 James Henstridge                address@hidden
 James R. Van Zandt              address@hidden
 James Youngman                  address@hidden
@@ -245,6 +246,7 @@ Matthew D. Langston             address@hidden
 Matthias Andree                 address@hidden
 Matthias Clasen                 address@hidden
 Matthias Klose                  address@hidden
+Max Horn                        address@hidden
 Maxim Sinev                     address@hidden
 Maynard Johnson                 address@hidden
 Merijn de Jonge                 address@hidden
diff --git a/configure.ac b/configure.ac
index 8b47bb0..be050f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -299,6 +299,14 @@ AC_DEFUN([_AM_CHECK_CANDIDATE_SHELL],
       [], [am_score=1; break])
 
     _AM_CHECK_SHELL_FEATURE([$1],
+      [supports address@hidden:@var}],
+      [zero='' one='x' twelve=' foobar baz!' \
+        && test address@hidden:@zero} -eq 0 \
+        && test address@hidden:@one} -eq 1 \
+        && test address@hidden:@twelve} -eq 12],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
       [supports address@hidden:@glob} and \${var%glob}],
       [v=a/b/c \
         && test address@hidden:@*/} = b/c \
@@ -444,12 +452,23 @@ _AM_COMPILER_CAN_FAIL(dnl
 
 AS_IF([test x"$GCC" = x"yes"], [am_CC_is_GNU=yes], [am_CC_is_GNU=no])
 
+# On case-insensitive file systems (seen e.g. on Cygwin and Mac OS X)
+# we must avoid looking for 'CC', because that would be the same as
+# 'cc', and could cause $CXX to point to the C compiler, instead of
+# to a C++ compiler as expected.  See automake bugs #11893 and #10766.
+if test -f /bIn/rMdIr || test -f /uSr/bIn/rMdIr; then
+  # Case-insensitive file system, don't look for CC.
+  am_CC=
+else
+  am_CC=CC
+fi
+
 # The list of C++ compilers here has been copied, pasted and edited
 # from 'lib/autoconf/c.m4:AC_PROG_CXX' in the Autoconf distribution.
 # Keep it in sync, or better again, find out a way to avoid this code
 # duplication.
 _AM_COMPILER_CAN_FAIL([AC_PROG_CXX(dnl
-  [aCC CC FCC KCC RCC xlC_r xlC c++ cxx cc++ gpp g++])],
+  [aCC $am_CC FCC KCC RCC xlC_r xlC c++ cxx cc++ gpp g++])],
   [CXX=false; _AM_SKIP_COMP_TESTS([C++])])
 
 AS_IF([test x"$GXX" = x"yes"], [am_CXX_is_GNU=yes], [am_CXX_is_GNU=no])
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 52f0fa4..fd2c39d 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -18,16 +18,17 @@ am__dist_common += %DIST-COMMON%
 
 ## Use 'sort', not 'am__uniq', for performance reasons.  Luckily, we
 ## don't care in which order the distributed files are.
-am__dist_files = $(strip $(sort \
-  $(am__dist_common) $(am__dist_sources) $(TEXINFOS) $(EXTRA_DIST)))
+am__dist_files = $(call am__memoize,am__dist_files,$(strip $(sort \
+  $(am__dist_common) $(am__dist_sources) $(TEXINFOS) $(EXTRA_DIST))))
 
 ## Try to avoid repeated slashed in the entries, to make the
 ## filtering in the 'am__dist_files_1' definition below more reliable.
 ## This idiom should compress up to four consecutive '/' characters in
 ## each $(am__dist_files) entry.
-am__dist_files_1 = $(subst //,/,$(subst //,/,$(am__dist_files)))
+am__dist_files_1 = $(call am__memoize,am__dist_files_1, \
+  $(subst //,/,$(subst //,/,$(am__dist_files))))
 
-am__dist_files_2 = \
+am__dist_files_2 = $(call am__memoize,am__dist_files_2, \
 ## Files filtered out here require an ad-hoc "munging"; see the two
 ## following 'patsubst's.
   $(filter-out $(srcdir)/% $(top_srcdir)/%, $(am__dist_files_1)) \
@@ -50,10 +51,11 @@ am__dist_files_2 = \
 ## prepended later by our VPATH-aware rules.
 ## The same caveats reported above apply.
   $(patsubst $(top_srcdir)/%, $(top_builddir)/%, \
-             $(filter $(top_srcdir)/%, $(am__dist_files_1)))
+             $(filter $(top_srcdir)/%, $(am__dist_files_1))))
 
 ## Strip extra whitespaces, for more safety.
-am__dist_files_cooked = $(strip $(am__dist_files_2))
+am__dist_files_cooked = \
+  $(call am__memoize,am__dist_files_cooked,$(strip $(am__dist_files_2)))
 
 ## Given the pre-processing done above to the list of distributed files,
 ## this definition ensures that we won't try to create the wrong
@@ -63,8 +65,15 @@ am__dist_files_cooked = $(strip $(am__dist_files_2))
 ## will allow our rules to correctly create "$(distdir)/subdir", and not
 ## "$(distdir)/$(srcdir)/subdir" -- which, in a VPATH build where
 ## "$(subdir) = ..", would be the build directory!
-am__dist_parent_dirs = $(strip $(sort \
-  $(filter-out ., $(patsubst ./%,%,$(dir $(am__dist_files_cooked))))))
+am__dist_parent_dirs = \
+  $(call am__memoize,am__dist_parent_dirs,$(strip $(sort \
+    $(filter-out ., $(patsubst ./%,%,$(dir $(am__dist_files_cooked)))))))
+
+am.mkdir-for-dist = \
+  @$(MKDIR_P) $(patsubst %,"$(distdir)"/%,$1)$(am__newline)
+am.write-list-of-distfiles = \
+  @lst='$1'; for x in $$lst; do echo $$x; done \
+    >> $(am__dir)/address@hidden(am__newline)
 
 if %?TOPDIR_P%
 distdir = $(PACKAGE)-$(VERSION)
@@ -124,7 +133,7 @@ if %?SUBDIRS%
 AM_RECURSIVE_TARGETS += distdir
 endif %?SUBDIRS%
 
-distdir: $(am__dist_files)
+distdir: $(am__dist_files) | $(am__dir)
 ##
 ## For Gnits users, this is pretty handy.  Look at 15 lines
 ## in case some explanatory text is desirable.
@@ -146,16 +155,19 @@ if %?TOPDIR_P%
        $(am__remove_distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
 endif %?TOPDIR_P%
-## Make the subdirectories for the files.
-       @$(if $(am__dist_parent_dirs),\
-          $(MKDIR_P) $(patsubst %,"$(distdir)"/%,$(am__dist_parent_dirs)))
+## Make the subdirectories for the files, avoiding to exceed command
+## line length limitations.
+       $(call am.xargs-map,am.mkdir-for-dist,$(am__dist_parent_dirs))
 ## Install the files and directories, applying a "VPATH rewrite"
 ## by hand where needed.
 ## To get the files in the distribution directory, use 'cp', not 'ln'.
 ## There are situations in which 'ln' can fail.  For instance a file to
 ## distribute could actually be a cross-filesystem symlink -- this can
 ## easily happen if "gettextize" was run on the distribution.
-       @lst='$(am__dist_files_cooked)'; for file in $$lst; do \
+       @rm -f $(am__dir)/address@hidden
+       $(call am.xargs-map,am.write-list-of-distfiles, \
+              $(am__dist_files_cooked))
+       @while read file; do \
 ## Always look for the file or directory to distribute in the build
 ## directory first, in VPATH spirit.
          if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
@@ -188,7 +200,7 @@ endif %?TOPDIR_P%
            || cp -p $$d/$$file "$(distdir)/$$file" \
            || exit 1; \
          fi; \
-       done
+       done < $(am__dir)/address@hidden
 ##
 ## Test for directory existence here because previous automake
 ## invocation might have created some directories.  Note that we
diff --git a/lib/ylwrap b/lib/ylwrap
index 3911cb0..867b99f 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -1,7 +1,7 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
 
-scriptversion=2011-08-25.18; # UTC
+scriptversion=2012-07-14.08; # UTC
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
@@ -29,6 +29,37 @@ scriptversion=2011-08-25.18; # UTC
 # bugs to <address@hidden> or send patches to
 # <address@hidden>.
 
+get_dirname ()
+{
+  case $1 in
+    */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
+    # Otherwise,  we want the empty string (not ".").
+  esac
+}
+
+# guard FILE
+# ----------
+# The CPP macro used to guard inclusion of FILE.
+guard()
+{
+  printf '%s\n' "$from" \
+    | sed \
+        -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+        -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'
+}
+
+# quote_for_sed [STRING]
+# ----------------------
+# Return STRING (or stdin) quoted to be used as a sed pattern.
+quote_for_sed ()
+{
+  case $# in
+    0) cat;;
+    1) printf '%s\n' "$1";;
+  esac \
+    | sed -e 's|[][\\.*]|\\&|g'
+}
+
 case "$1" in
   '')
     echo "$0: No files given.  Try '$0 --help' for more information." 1>&2
@@ -62,19 +93,6 @@ EOF
     ;;
 esac
 
-get_dirname ()
-{
-  case $1 in
-    */*|*\\*) printf '%s\n' "$1" | sed -e 's,\([\\/]\)[^\\/]*$,\1,';;
-    # Otherwise,  we want the empty string (not ".").
-  esac
-}
-
-quote_for_sed ()
-{
-  # FIXME: really we should care about more than '.' and '\'.
-  sed -e 's,[\\.],\\&,g'
-}
 
 # The input.
 input="$1"
@@ -90,15 +108,40 @@ case "$input" in
     input="`pwd`/$input"
     ;;
 esac
+input_rx=`get_dirname "$input" | quote_for_sed`
+
+# Since DOS filename conventions don't allow two dots,
+# the DOS version of Bison writes out y_tab.c instead of y.tab.c
+# and y_tab.h instead of y.tab.h. Test to see if this is the case.
+y_tab_nodot=false
+if test -f y_tab.c || test -f y_tab.h; then
+  y_tab_nodot=true
+fi
 
-pairlist=
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
+# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
+# instance, we rename #include "y.tab.h" into #include "parse.h"
+# during the conversion from y.tab.c to parse.c.
+rename_sed=
 while test "$#" -ne 0; do
   if test "$1" = "--"; then
     shift
     break
   fi
-  pairlist="$pairlist $1"
+  from=$1
+  # Handle y_tab.c and y_tab.h output by DOS
+  if $y_tab_nodot; then
+    case $from in
+      "y.tab.c") from=y_tab.c;;
+      "y.tab.h") from=y_tab.h;;
+    esac
+  fi
+  shift
+  to=$1
   shift
+  rename_sed="${rename_sed}s|"`quote_for_sed "$from"`"|$to|g;"
 done
 
 # The program to run.
@@ -129,90 +172,55 @@ esac
 ret=$?
 
 if test $ret -eq 0; then
-  set X $pairlist
-  shift
-  first=yes
-  # Since DOS filename conventions don't allow two dots,
-  # the DOS version of Bison writes out y_tab.c instead of y.tab.c
-  # and y_tab.h instead of y.tab.h. Test to see if this is the case.
-  y_tab_nodot="no"
-  if test -f y_tab.c || test -f y_tab.h; then
-    y_tab_nodot="yes"
-  fi
-
-  input_rx=`get_dirname "$input" | quote_for_sed`
-
-  while test "$#" -ne 0; do
-    from="$1"
-    # Handle y_tab.c and y_tab.h output by DOS
-    if test $y_tab_nodot = "yes"; then
-      if test $from = "y.tab.c"; then
-        from="y_tab.c"
-      else
-        if test $from = "y.tab.h"; then
-          from="y_tab.h"
-        fi
-      fi
-    fi
+  for from in *
+  do
+    to=`printf '%s\n' "$from" | sed "$rename_sed"`
     if test -f "$from"; then
       # If $2 is an absolute path name, then just use that,
       # otherwise prepend '../'.
-      case "$2" in
-        [\\/]* | ?:[\\/]*) target="$2";;
-        *) target="../$2";;
+      case $to in
+        [\\/]* | ?:[\\/]*) target=$to;;
+        *) target="../$to";;
       esac
 
-      # We do not want to overwrite a header file if it hasn't
-      # changed.  This avoid useless recompilations.  However the
-      # parser itself (the first file) should always be updated,
-      # because it is the destination of the .y.c rule in the
-      # Makefile.  Divert the output of all other files to a temporary
-      # file so we can compare them to existing versions.
-      if test $first = no; then
+      # Do not overwrite unchanged header files to avoid useless
+      # recompilations.  Always update the parser itself: it is the
+      # destination of the .y.c rule in the Makefile.  Divert the
+      # output of all other files to a temporary file so we can
+      # compare them to existing versions.
+      if test $from != $parser; then
         realtarget="$target"
-        target="tmp-`echo $target | sed s/.*[\\/]//g`"
+        target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
       fi
-      # Munge "#line" or "#" directives.
-      # We don't want the resulting debug information to point at
-      # an absolute srcdir.
-      # We want to use the real output file name, not yy.lex.c for
-      # instance.
-      # We want the include guards to be adjusted too.
-      FROM=`echo "$from" | sed \
-            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-      TARGET=`echo "$2" | sed \
-            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-
-      sed -e "/^#/!b" -e "s,$input_rx,$input_sub_rx," -e "s,$from,$2," \
-          -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
-
-      # Check whether header files must be updated.
-      if test $first = no; then
+
+      # Munge "#line" or "#" directives.  Don't let the resulting
+      # debug information point at an absolute srcdir.  Use the real
+      # output file name, not yy.lex.c for instance.  Adjust the
+      # include guards too.
+      FROM=`guard "$from"`
+      TARGET=`guard "$to"`
+      sed -e "/^#/!b" -e "s|$input_rx|$input_sub_rx|" -e "$rename_sed" \
+          -e "s|$FROM|$TARGET|" "$from" >"$target" || ret=$?
+
+      # Check whether files must be updated.
+      if test "$from" != "$parser"; then
         if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
-          echo "$2" is unchanged
+          echo "$to is unchanged"
           rm -f "$target"
         else
-          echo updating "$2"
+          echo "updating $to"
           mv -f "$target" "$realtarget"
         fi
       fi
     else
-      # A missing file is only an error for the first file.  This
-      # is a blatant hack to let us support using "yacc -d".  If -d
-      # is not specified, we don't want an error when the header
-      # file is "missing".
-      if test $first = yes; then
+      # A missing file is only an error for the parser.  This is a
+      # blatant hack to let us support using "yacc -d".  If -d is not
+      # specified, don't fail when the header file is "missing".
+      if test "$from" = "$parser"; then
         ret=1
       fi
     fi
-    shift
-    shift
-    first=no
   done
-else
-  ret=$?
 fi
 
 # Remove the directory.
diff --git a/m4/amversion.in b/m4/amversion.in
index e44ace1..3661259 100644
--- a/m4/amversion.in
+++ b/m4/amversion.in
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index 74e7972..368cd64 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
diff --git a/m4/ar-lib.m4 b/m4/ar-lib.m4
index 470def4..b6b6b0f 100644
--- a/m4/ar-lib.m4
+++ b/m4/ar-lib.m4
@@ -5,8 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_PROG_AR([ACT-IF-FAIL])
 # -------------------------
 # Try to determine the archiver interface, and trigger the ar-lib wrapper
diff --git a/m4/as.m4 b/m4/as.m4
index fa6d3c8..27b3220 100644
--- a/m4/as.m4
+++ b/m4/as.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
-
 # AM_PROG_AS
 # ----------
 AC_DEFUN([AM_PROG_AS],
diff --git a/m4/auxdir.m4 b/m4/auxdir.m4
index 3dda02b..9cd72c3 100644
--- a/m4/auxdir.m4
+++ b/m4/auxdir.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
diff --git a/m4/cond-if.m4 b/m4/cond-if.m4
index 80e687b..38f5ec9 100644
--- a/m4/cond-if.m4
+++ b/m4/cond-if.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_COND_IF
 # _AM_COND_ELSE
 # _AM_COND_ENDIF
@@ -17,7 +15,6 @@ m4_define([_AM_COND_IF])
 m4_define([_AM_COND_ELSE])
 m4_define([_AM_COND_ENDIF])
 
-
 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
 # ---------------------------------------
 # If the shell condition COND is true, execute IF-TRUE, otherwise execute
diff --git a/m4/cond.m4 b/m4/cond.m4
index 03644ab..9ea857e 100644
--- a/m4/cond.m4
+++ b/m4/cond.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
-
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
diff --git a/m4/depend.m4 b/m4/depend.m4
index caa984b..08ca1e7 100644
--- a/m4/depend.m4
+++ b/m4/depend.m4
@@ -5,7 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 17
 
 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
diff --git a/m4/dmalloc.m4 b/m4/dmalloc.m4
index 536ea91..3e7fdb7 100644
--- a/m4/dmalloc.m4
+++ b/m4/dmalloc.m4
@@ -9,8 +9,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
-
 AC_DEFUN([AM_WITH_DMALLOC],
 [AC_MSG_CHECKING([if malloc debugging is wanted])
 AC_ARG_WITH([dmalloc],
diff --git a/m4/gcj.m4 b/m4/gcj.m4
index e7cdd69..fd2a5df 100644
--- a/m4/gcj.m4
+++ b/m4/gcj.m4
@@ -7,8 +7,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 AC_DEFUN([AM_PROG_GCJ],
 [AC_CHECK_TOOLS([GCJ], [gcj], [gcj])
 test -z "$GCJ" && AC_MSG_ERROR([no acceptable gcj found in \$PATH])
diff --git a/m4/init.m4 b/m4/init.m4
index d927b79..ed7ce47 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 22
-
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
diff --git a/m4/install-sh.m4 b/m4/install-sh.m4
index 8061e7e..f51c027 100644
--- a/m4/install-sh.m4
+++ b/m4/install-sh.m4
@@ -5,8 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
diff --git a/m4/lex.m4 b/m4/lex.m4
index 4cda8a9..6eb4a91 100644
--- a/m4/lex.m4
+++ b/m4/lex.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # AM_PROG_LEX
 # -----------
 # Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
diff --git a/m4/lispdir.m4 b/m4/lispdir.m4
index c4840f4..72dcd84 100644
--- a/m4/lispdir.m4
+++ b/m4/lispdir.m4
@@ -9,8 +9,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
-
 # AM_PATH_LISPDIR
 # ---------------
 AC_DEFUN([AM_PATH_LISPDIR],
diff --git a/m4/maintainer.m4 b/m4/maintainer.m4
index ffc1ddf..62eef9c 100644
--- a/m4/maintainer.m4
+++ b/m4/maintainer.m4
@@ -7,8 +7,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_MAINTAINER_MODE([DEFAULT-MODE])
 # ----------------------------------
 # Control maintainer-specific portions of Makefiles.
diff --git a/m4/minuso.m4 b/m4/minuso.m4
index 7787ddf..50af200 100644
--- a/m4/minuso.m4
+++ b/m4/minuso.m4
@@ -5,8 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # AM_PROG_CC_C_O
 # --------------
 # Like AC_PROG_CC_C_O, but changed for automake.
diff --git a/m4/missing.m4 b/m4/missing.m4
index 2de7fe4..a246a9c 100644
--- a/m4/missing.m4
+++ b/m4/missing.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
 AC_DEFUN([AM_MISSING_PROG],
@@ -15,7 +13,6 @@ AC_DEFUN([AM_MISSING_PROG],
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
 
-
 # AM_MISSING_HAS_RUN
 # ------------------
 # Define MISSING if not defined so far and test if it is modern enough.
diff --git a/m4/options.m4 b/m4/options.m4
index 76ad642..ebf3cf0 100644
--- a/m4/options.m4
+++ b/m4/options.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
diff --git a/m4/protos.m4 b/m4/protos.m4
index 942154b..c8c7adc 100644
--- a/m4/protos.m4
+++ b/m4/protos.m4
@@ -7,8 +7,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 AC_DEFUN([AM_C_PROTOTYPES],
          [AC_FATAL([automatic de-ANSI-fication support has been removed])])
 
diff --git a/m4/python.m4 b/m4/python.m4
index 3548886..a247818 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -9,7 +9,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
 
 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 # ---------------------------------------------------------------------------
diff --git a/m4/runlog.m4 b/m4/runlog.m4
index 6d127a8..d983b71 100644
--- a/m4/runlog.m4
+++ b/m4/runlog.m4
@@ -5,8 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_RUN_LOG(COMMAND)
 # -------------------
 # Run COMMAND, save the exit status in ac_status, and log it.
diff --git a/m4/sanity.m4 b/m4/sanity.m4
index c90bc98..0415711 100644
--- a/m4/sanity.m4
+++ b/m4/sanity.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
-
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
diff --git a/m4/silent.m4 b/m4/silent.m4
index 7f4d4b4..d93244f 100644
--- a/m4/silent.m4
+++ b/m4/silent.m4
@@ -5,8 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # AM_SILENT_RULES([DEFAULT])
 # --------------------------
 # Enable less verbose build rules; with the default set to DEFAULT
diff --git a/m4/strip.m4 b/m4/strip.m4
index 9dfbf66..a40d66e 100644
--- a/m4/strip.m4
+++ b/m4/strip.m4
@@ -5,8 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # AM_PROG_INSTALL_STRIP
 # ---------------------
 # One issue with vendor 'install' (even GNU) is that you can't
diff --git a/m4/substnot.m4 b/m4/substnot.m4
index 22a2612..d86585a 100644
--- a/m4/substnot.m4
+++ b/m4/substnot.m4
@@ -5,8 +5,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake-NG from outputting VARIABLE = @VARIABLE@ in Makefile.in.
diff --git a/m4/tar.m4 b/m4/tar.m4
index 244c729..d3e23dd 100644
--- a/m4/tar.m4
+++ b/m4/tar.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
diff --git a/m4/upc.m4 b/m4/upc.m4
index 9ba1025..0df8197 100644
--- a/m4/upc.m4
+++ b/m4/upc.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 AC_DEFUN([AM_PROG_UPC],
 [dnl We need OBJEXT and EXEEXT, but Autoconf doesn't offer any public
 dnl macro to compute them.  Use AC_PROG_CC instead.
diff --git a/m4/vala.m4 b/m4/vala.m4
index cc6ba53..5dad452 100644
--- a/m4/vala.m4
+++ b/m4/vala.m4
@@ -6,8 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # Check whether the Vala compiler exists in $PATH. If it is found, the
 # variable VALAC is set. Optionally a minimum release number of the
 # compiler can be requested.
diff --git a/t/aclocal7.sh b/t/aclocal7.sh
index 4c03a0c..c050b07 100755
--- a/t/aclocal7.sh
+++ b/t/aclocal7.sh
@@ -45,6 +45,11 @@ AUTOMAKE_after_aclocal ()
   $AUTOMAKE --no-force
 }
 
+# aclocal will rewrite aclocal.m4 unless the input files are all older than the
+# existing aclocal.m4 -- sleep to ensure somedefs.m4 has an older timestamp
+# than the aclocal.m4 that the next aclocal call will generate.
+$sleep
+
 $ACLOCAL -I m4
 AUTOMAKE_after_aclocal
 
diff --git a/t/dist-many.sh b/t/dist-many.sh
new file mode 100755
index 0000000..e006c01
--- /dev/null
+++ b/t/dist-many.sh
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 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/>.
+
+# Check that our dist rules do not hit errors due to a huge number
+# of files to be distributed.  Checks similar in spirit are done by
+# sister test 'dist-many2.sh', which fakes an artificially low
+# command line length limit for 'mkdir' and the shell.
+
+. ./defs || exit 1
+
+echo AC_OUTPUT >> configure.ac
+
+file=an-empty-file-with-a-long-name
+dir1=a-directory-with-a-long-name
+dir2=another-long-named-directory
+
+# Distributed files will be 3 * $count.
+count=10000
+
+i=1
+while test $i -le $count; do
+  files="
+    $file.$i
+    $dir1.$i/foo
+    $dir2.$i/$file.$i
+  "
+  mkdir $dir1.$i $dir2.$i
+  for f in $files; do
+    : > $f
+    echo $f
+  done
+  i=$(($i + 1))
+  # Disable shell traces after the first iteration, to avoid
+  # polluting the test logs.
+  set +x
+done > t
+set -x # Re-enable shell traces.
+echo 'EXTRA_DIST = \'   >> Makefile.am
+sed 's/$/ \\/' t        >> Makefile.am
+echo '$(am__empty)'     >> Makefile.am
+rm -f t
+
+test $(wc -l <Makefile.am) -eq $(( 2 + (3 * $count) )) \
+  || fatal_ "populating 'EXTRA_DIST'"
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE distdir
+
+# Only check head, tail, and a random sample.
+
+test -f $distdir/$file.1
+test -f $distdir/$dir1.1/foo
+test -f $distdir/$dir2.1/$file.1
+
+test -f $distdir/$file.$count
+test -f $distdir/$dir1.$count/foo
+test -f $distdir/$dir2.$count/$file.$count
+
+test -f $distdir/$file.163
+test -f $distdir/$dir1.7645/foo
+test -f $distdir/$dir2.4077/$file.4077
+
+$MAKE distcheck
+
+:
diff --git a/t/dist-many2.sh b/t/dist-many2.sh
new file mode 100755
index 0000000..09e9d26
--- /dev/null
+++ b/t/dist-many2.sh
@@ -0,0 +1,119 @@
+#! /bin/sh
+# Copyright (C) 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/>.
+
+# Check that our dist rules do not hit errors due to an exceeded
+# command line length when there are many files to distribute.  Here,
+# we fake a very low command line length limit for 'mkdir' (max 50
+# arguments) and the shell (max 2000 chars in its command line).
+# The sister test 'dist-many.sh' try to hit the real command line length
+# limit of the system, by declaring a huge number of files to be cleaned.
+
+. ./defs || exit 1
+
+mkdir bin
+
+cat > bin/mkdir << END
+#!$AM_TEST_RUNNER_SHELL -u
+PATH='$PATH'; export PATH
+END
+cat >> bin/mkdir << 'END'
+if test $# -eq 0; then
+  echo "mkdir: missing argument" >&2
+  exit 1
+elif test $# -gt 50; then
+  echo "mkdir: argument list too long ($# arguments)" >&2
+  exit 1
+fi
+exec mkdir "$@"
+END
+
+cat > bin/am--sh << END
+#!$AM_TEST_RUNNER_SHELL -u
+sh='$SHELL'
+END
+cat >> bin/am--sh << 'END'
+cmdline=$*
+cmdline_len=${#cmdline}
+test $cmdline_len -le 4000 || {
+  echo "sh: command line to long (~ $cmdline_len characters)" >&2
+  exit 1
+}
+exec $sh "$@"
+END
+
+chmod a+x bin/mkdir bin/am--sh
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
+CONFIG_SHELL=$(pwd)/bin/am--sh; export CONFIG_SHELL
+
+echo AC_OUTPUT >> configure.ac
+
+file=an-empty-file-with-a-long-name
+dir1=a-directory-with-a-long-name
+dir2=another-long-named-directory
+
+# Distributed files will be 3 * $count.
+count=200
+
+i=1
+while test $i -le $count; do
+  files="
+    $file.$i
+    $dir1.$i/foo
+    $dir2.$i/$file.$i
+  "
+  mkdir $dir1.$i $dir2.$i
+  for f in $files; do
+    : > $f
+    echo $f
+  done
+  i=$(($i + 1))
+  # Disable shell traces after the first iteration, to avoid
+  # polluting the test logs.
+  set +x
+done > t
+set -x # Re-enable shell traces.
+echo 'EXTRA_DIST = \'   >> Makefile.am
+sed 's/$/ \\/' t        >> Makefile.am
+echo '$(am__empty)'     >> Makefile.am
+rm -f t
+
+test $(wc -l <Makefile.am) -eq $(( 2 + (3 * $count) )) \
+  || fatal_ "populating 'EXTRA_DIST'"
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE distdir
+
+# Only check head, tail, and a random sample.
+
+test -f $distdir/$file.1
+test -f $distdir/$dir1.1/foo
+test -f $distdir/$dir2.1/$file.1
+
+test -f $distdir/$file.$count
+test -f $distdir/$dir1.$count/foo
+test -f $distdir/$dir2.$count/$file.$count
+
+test -f $distdir/$file.87
+test -f $distdir/$dir1.32/foo
+test -f $distdir/$dir2.15/$file.15
+
+$MAKE distcheck
+
+:
diff --git a/t/self-check-exit.tap b/t/self-check-exit.tap
index 0fbc9d8..19cf27a 100755
--- a/t/self-check-exit.tap
+++ b/t/self-check-exit.tap
@@ -22,7 +22,7 @@
 am_create_testdir=no
 . ./defs || exit 99
 
-plan_ 34
+plan_ 32
 
 # This test becomes more cumbersome if we keep the 'errexit' shell flag
 # set.  And removing it is no big deal, as this test is a TAP-based one,
@@ -79,10 +79,4 @@ test -f Makefile && test ! -x Makefile || \
 $AM_TEST_RUNNER_SHELL -c "$init ./Makefile; :" "$dummy_test_script"
 command_ok_ "permission denied" test $? -gt 0
 
-: Syntax errors in the test code.
-$AM_TEST_RUNNER_SHELL -c "$init if :; then" "$dummy_test_script"
-command_ok_ "syntax error 1" test $? -gt 0
-$AM_TEST_RUNNER_SHELL -c "$init true ( true )" "$dummy_test_script"
-command_ok_ "syntax error 2" test $? -gt 0
-
 :
diff --git a/t/yacc-bison-skeleton-cxx.sh b/t/yacc-bison-skeleton-cxx.sh
index 315dc33..efe9465 100755
--- a/t/yacc-bison-skeleton-cxx.sh
+++ b/t/yacc-bison-skeleton-cxx.sh
@@ -40,10 +40,15 @@ END
 cat > zardoz.yy << 'END'
 %skeleton "lalr1.cc"
 %defines
+%locations
 
+%union
+{
+  int ival;
+};
 %{
-#define YYSTYPE int
-int yylex(YYSTYPE* yylval_param);
+int yylex (yy::parser::semantic_type *yylval,
+           yy::parser::location_type *yylloc);
 %}
 
 %%
@@ -51,23 +56,22 @@ start :        /* empty */
 %%
 
 int
-yylex(YYSTYPE*)
+yylex (yy::parser::semantic_type *yylval,
+       yy::parser::location_type *yylloc)
 {
-    return 0;
+  return 0;
 }
 
 void
-yy::parser::error(const yy::parser::location_type&, const std::string& m)
+yy::parser::error(const yy::parser::location_type&, const std::string&)
 {
-    return;
+  return;
 }
 END
 
 cat > foo.cc << 'END'
 #include "zardoz.hh"
 
-using namespace std;
-
 int
 main(int argc, char** argv)
 {
diff --git a/t/yacc-bison-skeleton.sh b/t/yacc-bison-skeleton.sh
index 9b0c376..64fbce8 100755
--- a/t/yacc-bison-skeleton.sh
+++ b/t/yacc-bison-skeleton.sh
@@ -30,16 +30,20 @@ cat > Makefile.am << 'END'
 bin_PROGRAMS = zardoz
 zardoz_SOURCES = zardoz.y foo.c
 AM_YFLAGS = -d --skeleton glr.c
+BUILT_SOURCES = zardoz.h
 END
 
 # Parser.
 cat > zardoz.y << 'END'
 %{
-int yylex () { return 0; }
-void yyerror (const char *s) { return; }
+int yylex ();
+void yyerror (const char *s);
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+%%
+int yylex () { return 0; }
+void yyerror (const char *s) { return; }
 END
 
 cat > foo.c << 'END'
diff --git a/t/yacc-d-basic.sh b/t/yacc-d-basic.sh
index 905c04c..f8ff475 100755
--- a/t/yacc-d-basic.sh
+++ b/t/yacc-d-basic.sh
@@ -54,7 +54,14 @@ void yyerror (char *s) {}
 x : 'x' {};
 %%
 END
-cp foo/parse.y bar/parse.y
+# Using ylwrap, we actually generate y.tab.[ch].  Unfortunately, we
+# forgot to rename #include "y.tab.h" into #include "parse.h" during
+# the conversion from y.tab.c to parse.c.  This was OK when Bison was
+# not issuing such an #include (up to 2.6).
+#
+# To make sure that we perform this conversion, in bar/parse.y, use
+# y.tab.h instead of parse.c.
+sed -e 's/parse\.h/y.tab.h/' <foo/parse.y >bar/parse.y
 
 cat > foo/main.c << 'END'
 #include "parse.h"


hooks/post-receive
-- 
GNU Automake



reply via email to

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