autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.63-83-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63-83-gca44a30
Date: Wed, 22 Oct 2008 11:18:08 +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 Autoconf source repository".

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

The branch, master has been updated
       via  ca44a30bdd14b07a37515bcfaa5ed85cd3188360 (commit)
       via  d2d24b537fe60abe1084bd65ef6364c181bfa173 (commit)
       via  ca7380b2a8b79b99ec1def4d248febfe9facfa97 (commit)
       via  0467924f2464ae13f05644fc524a36848584444f (commit)
       via  e84e41e106b75ee368627a8c93d49c564d7dec15 (commit)
       via  b837cd019d07cffa7eb5609b0492330c94c7fcdd (commit)
       via  6d4ddfda94ca34ce164d40af710d99317ddfc536 (commit)
       via  6ae40b3dae7b6c05b1b2750fc90b1eb00c56d611 (commit)
       via  86ce15b622cdde04ec0569b22905c67168936407 (commit)
      from  89839f42af89bee9509b5f38190acdbeab263455 (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 ca44a30bdd14b07a37515bcfaa5ed85cd3188360
Author: Eric Blake <address@hidden>
Date:   Wed Oct 22 05:16:58 2008 -0600

    Fix testsuite failure.
    
    * tests/mktests.sh (ac_exclude_list): Don't generate test for
    AC_REQUIRE_SHELL_FN.
    
    Signed-off-by: Eric Blake <address@hidden>

commit d2d24b537fe60abe1084bd65ef6364c181bfa173
Author: Eric Blake <address@hidden>
Date:   Thu Oct 16 07:38:07 2008 -0600

    Improve wording related to automake and autotest.
    
    * doc/autoconf.texi (Making testsuite Scripts): Clarify wording in
    relation to automake.  Mention dependency on package.m4.
    Consolidate examples.  Define AUTOM4TE.
    * THANKS: Update.
    Reported by William Pursell.
    
    Signed-off-by: Eric Blake <address@hidden>

commit ca7380b2a8b79b99ec1def4d248febfe9facfa97
Author: Eric Blake <address@hidden>
Date:   Mon Oct 20 17:14:03 2008 -0600

    Allow AS_VAR_SET_IF in shell lists.
    
    * lib/m4sugar/m4sh.m4 (AS_VAR_SET_IF): Allow continuation of
    line.
    * lib/autoconf/general.m4 (AC_CACHE_VAL): Supply newline no longer
    provided by AS_VAR_SET_IF.
    * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Adjust
    clients.
    * lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
    * tests/m4sh.at (AS@&address@hidden basics): Enhance test.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 0467924f2464ae13f05644fc524a36848584444f
Author: Eric Blake <address@hidden>
Date:   Mon Oct 20 16:56:12 2008 -0600

    Allow AS_VAR_IF in shell lists.
    
    * lib/m4sugar/m4sh.m4 (AS_VAR_IF): Allow continuation of line.
    * lib/autoconf/functions.m4 (AC_CHECK_FUNC): Adjust clients.
    * lib/autoconf/general.m4 (AC_CHECK_FILE, AC_CHECK_DECL):
    Likewise.
    * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL)
    (_AC_CHECK_HEADER_NEW, _AC_CHECK_HEADER_OLD)
    (_AC_CHECK_HEADER_DIRENT): Likewise.
    * lib/autoconf/libs.m4 (AC_CHECK_LIB): Likewise.
    * lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW, AC_CHECK_MEMBER):
    Likewise.
    * tests/m4sh.at (AS@&address@hidden basics): Enhance test.
    
    Signed-off-by: Eric Blake <address@hidden>

commit e84e41e106b75ee368627a8c93d49c564d7dec15
Author: Eric Blake <address@hidden>
Date:   Mon Oct 20 16:43:41 2008 -0600

    Allow AS_CASE in shell lists.
    
    * lib/m4sugar/m4sh.m4 (AS_CASE): Always execute test, in case of
    side effects.  Allow continuation of script on same line as esac.
    * lib/autoconf/c.m4 (AC_PROG_CC_STDC): Adjust client.
    * tests/m4sh.at (AS@&address@hidden and AS@&address@hidden): Enhance test.
    * NEWS: Document the subtle change.
    
    Signed-off-by: Eric Blake <address@hidden>

commit b837cd019d07cffa7eb5609b0492330c94c7fcdd
Author: Eric Blake <address@hidden>
Date:   Mon Oct 20 16:18:05 2008 -0600

    Allow AS_IF in shell lists.
    
    * lib/m4sugar/m4sh.m4 (AS_IF): Always execute test, in case of
    side effects.  Allow continuation of script on same line as fi.
    (_AS_DETECT_BETTER_SHELL): Adjust clients.
    (AS_VAR_IF, AS_VAR_SET_IF): For now, supply newline no longer
    given by AS_IF.
    * lib/autoconf/c.m4 (_AC_PROG_PREPROC_WORKS_IFELSE): Likewise.
    * lib/autoconf/general.m4 (_AC_ENABLE_IF): Likewise.
    (AC_EGREP_CPP, _AC_RUN_IFELSE): Adjust client.
    * lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
    * doc/autoconf.texi (Common Shell Constructs) <AS_IF>: Fix typo.
    (Polymorphic Variables): Move mention of dnl to the only two
    AS_VAR functions that need it.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 6d4ddfda94ca34ce164d40af710d99317ddfc536
Author: Paolo Bonzini <address@hidden>
Date:   Mon Oct 20 15:35:24 2008 +0200

    Use a shell function for _AC_COMPILE_IFELSE.
    
    * lib/autoconf/general.m4 (_AC_COMPILE_IFELSE_BODY): New macro.
    (_AC_COMPILE_IFELSE): Use a shell function.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 6ae40b3dae7b6c05b1b2750fc90b1eb00c56d611
Author: Eric Blake <address@hidden>
Date:   Tue Oct 21 10:28:19 2008 -0600

    Use AS_VAR_APPEND.
    
    * lib/autoconf/functions.m4 (AC_CHECK_FUNCS_ONCE): Use new macro.
    * lib/autoconf/general.m4 (_AC_INIT_PREPARE)
    (_AC_LIBOBJS_NORMALIZE): Likewise.
    * lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Likewise.
    * lib/autoconf/status.m4 (_AC_OUTPUT_SUBDIRS)
    (_AC_OUTPUT_CONFIG_STATUS, _AC_OUTPUT_MAIN_LOOP): Likewise.
    * lib/autotest/general.m4 (AT_INIT): Likewise.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 86ce15b622cdde04ec0569b22905c67168936407
Author: Eric Blake <address@hidden>
Date:   Mon Oct 20 05:50:01 2008 -0600

    Add AS_VAR_APPEND.
    
    * lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
    (_AS_VAR_APPEND_WORKS, AS_VAR_APPEND): New macros.
    (AS_PREPARE, _AS_PREPARE): Emit preparation.
    * tests/m4sh.at (AS@&address@hidden): New test.
    * doc/autoconf.texi (Polymorphic Variables) <AS_VAR_APPEND>:
    Document new macro.
    <AS_VAR_SET>: Mention ramification of `""` rules.
    * NEWS: Mention new macro.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 ChangeLog                 |   89 ++++++++++++++++++++++++++++++++++++++
 NEWS                      |    7 +++-
 THANKS                    |    1 +
 doc/autoconf.texi         |  103 ++++++++++++++++++++++++++++++--------------
 lib/autoconf/c.m4         |    5 +-
 lib/autoconf/functions.m4 |    8 ++--
 lib/autoconf/general.m4   |   66 ++++++++++++++++++-----------
 lib/autoconf/headers.m4   |   18 ++++----
 lib/autoconf/libs.m4      |    8 ++--
 lib/autoconf/status.m4    |   10 ++--
 lib/autoconf/types.m4     |    4 +-
 lib/autotest/general.m4   |   24 +++++-----
 lib/m4sugar/m4sh.m4       |   70 ++++++++++++++++++++++++------
 tests/m4sh.at             |   63 ++++++++++++++++++++++++---
 tests/mktests.sh          |    5 +-
 15 files changed, 361 insertions(+), 120 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f98b708..f150c5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,92 @@
+2008-10-22  Eric Blake  <address@hidden>
+
+       Fix testsuite failure.
+       * tests/mktests.sh (ac_exclude_list): Don't generate test for
+       AC_REQUIRE_SHELL_FN.
+
+2008-10-21  Eric Blake  <address@hidden>
+
+       Improve wording related to automake and autotest.
+       * doc/autoconf.texi (Making testsuite Scripts): Clarify wording in
+       relation to automake.  Mention dependency on package.m4.
+       Consolidate examples.  Define AUTOM4TE.
+       * THANKS: Update.
+       Reported by William Pursell.
+
+2008-10-21  Eric Blake  <address@hidden>
+
+       Allow AS_VAR_SET_IF in shell lists.
+       * lib/m4sugar/m4sh.m4 (AS_VAR_SET_IF): Allow continuation of
+       line.
+       * lib/autoconf/general.m4 (AC_CACHE_VAL): Supply newline no longer
+       provided by AS_VAR_SET_IF.
+       * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Adjust
+       clients.
+       * lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
+       * tests/m4sh.at (AS@&address@hidden basics): Enhance test.
+
+       Allow AS_VAR_IF in shell lists.
+       * lib/m4sugar/m4sh.m4 (AS_VAR_IF): Allow continuation of line.
+       * lib/autoconf/functions.m4 (AC_CHECK_FUNC): Adjust clients.
+       * lib/autoconf/general.m4 (AC_CHECK_FILE, AC_CHECK_DECL):
+       Likewise.
+       * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL)
+       (_AC_CHECK_HEADER_NEW, _AC_CHECK_HEADER_OLD)
+       (_AC_CHECK_HEADER_DIRENT): Likewise.
+       * lib/autoconf/libs.m4 (AC_CHECK_LIB): Likewise.
+       * lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW, AC_CHECK_MEMBER):
+       Likewise.
+       * tests/m4sh.at (AS@&address@hidden basics): Enhance test.
+
+       Allow AS_CASE in shell lists.
+       * lib/m4sugar/m4sh.m4 (AS_CASE): Always execute test, in case of
+       side effects.  Allow continuation of script on same line as esac.
+       * lib/autoconf/c.m4 (AC_PROG_CC_STDC): Adjust client.
+       * tests/m4sh.at (AS@&address@hidden and AS@&address@hidden): Enhance 
test.
+       * NEWS: Document the subtle change.
+
+       Allow AS_IF in shell lists.
+       * lib/m4sugar/m4sh.m4 (AS_IF): Always execute test, in case of
+       side effects.  Allow continuation of script on same line as fi.
+       (_AS_DETECT_BETTER_SHELL): Adjust clients.
+       (AS_VAR_IF, AS_VAR_SET_IF): For now, supply newline no longer
+       given by AS_IF.
+       * lib/autoconf/c.m4 (_AC_PROG_PREPROC_WORKS_IFELSE): Likewise.
+       * lib/autoconf/general.m4 (_AC_ENABLE_IF): Likewise.
+       (AC_EGREP_CPP, _AC_RUN_IFELSE): Adjust client.
+       * lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
+       * doc/autoconf.texi (Common Shell Constructs) <AS_IF>: Fix typo.
+       (Polymorphic Variables): Move mention of dnl to the only two
+       AS_VAR functions that need it.
+
+2008-10-21  Paolo Bonzini  <address@hidden>
+       and Eric Blake  <address@hidden>
+
+       Use a shell function for _AC_COMPILE_IFELSE.
+       * lib/autoconf/general.m4 (_AC_COMPILE_IFELSE_BODY): New macro.
+       (_AC_COMPILE_IFELSE): Use a shell function.
+
+2008-10-21  Eric Blake  <address@hidden>
+
+       Use AS_VAR_APPEND.
+       * lib/autoconf/functions.m4 (AC_CHECK_FUNCS_ONCE): Use new macro.
+       * lib/autoconf/general.m4 (_AC_INIT_PREPARE)
+       (_AC_LIBOBJS_NORMALIZE): Likewise.
+       * lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Likewise.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_SUBDIRS)
+       (_AC_OUTPUT_CONFIG_STATUS, _AC_OUTPUT_MAIN_LOOP): Likewise.
+       * lib/autotest/general.m4 (AT_INIT): Likewise.
+
+       Add AS_VAR_APPEND.
+       * lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
+       (_AS_VAR_APPEND_WORKS, AS_VAR_APPEND): New macros.
+       (AS_PREPARE, _AS_PREPARE): Emit preparation.
+       * tests/m4sh.at (AS@&address@hidden): New test.
+       * doc/autoconf.texi (Polymorphic Variables) <AS_VAR_APPEND>:
+       Document new macro.
+       <AS_VAR_SET>: Mention ramification of `""` rules.
+       * NEWS: Mention new macro.
+
 2008-10-21  Paolo Bonzini  <address@hidden>
        and Eric Blake  <address@hidden>
 
diff --git a/NEWS b/NEWS
index 147639b..8b682b8 100644
--- a/NEWS
+++ b/NEWS
@@ -17,13 +17,18 @@ GNU Autoconf NEWS - User visible changes.
    m4_set_map
 
 ** The following documented m4sh macros are new:
-   AS_LINENO_PREPARE  AS_ME_PREPARE  AS_VAR_COPY
+   AS_LINENO_PREPARE  AS_ME_PREPARE  AS_VAR_APPEND  AS_VAR_COPY
 
 ** The following m4sh macros are documented now:
    AS_ECHO  AS_ECHO_N  AS_LITERAL_IF  AS_UNSET  AS_VAR_IF  AS_VAR_POPDEF
    AS_VAR_PUSHDEF  AS_VAR_SET  AS_VAR_SET_IF  AS_VAR_TEST_SET
    AS_VERSION_COMPARE
 
+** The m4sh macros AS_IF and AS_CASE can now be used in shell lists.
+   The responsibility for supplying a trailing newline now belongs to
+   the call site, but since most users did not add dnl, this generally
+   results in fewer empty lines in configure.
+
 
 * Major changes in Autoconf 2.63 (2008-09-09) [stable]
   Released by Eric Blake, based on git versions 2.62.*.
diff --git a/THANKS b/THANKS
index 366bf62..977185f 100644
--- a/THANKS
+++ b/THANKS
@@ -354,6 +354,7 @@ Volker Borchert             address@hidden
 Wayne Chapeskie             address@hidden
 Werner Lemberg              address@hidden
 Wilfredo Sanchez            address@hidden
+William Pursell             address@hidden
 Wolfgang Mueller            address@hidden
 Yury Puhalsky               address@hidden
 Zack Weinberg               address@hidden
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index eed40c5..71f507f 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -11952,7 +11952,7 @@ Redirections can be placed outside the macro invocation.
 Run shell code @var{test1}.  If @var{test1} exits with a zero status then
 run shell code @var{run-if-true1}, else examine further tests.  If no test
 exits with a zero status, run shell code @var{run-if-false}, with
-simplifications if either @var{run-if-true1} or @var{run-if-false1}
+simplifications if either @var{run-if-true1} or @var{run-if-false}
 is empty.  For example,
 
 @example
@@ -12046,8 +12046,7 @@ M4sh supports the notion of polymorphic shell 
variables, making it easy
 to write a macro that can deal with either literal or indirect variable
 names and output shell code appropriate for both use cases.  Behavior is
 undefined if expansion of an indirect variable does not result in a
-literal variable name.  These macros are often followed with @code{dnl},
-to avoid excess newlines in the output.
+literal variable name.
 
 @defmac AS_LITERAL_IF (@var{expression}, @ovar{if-literal}, @ovar{if-not})
 @asindex{LITERAL_IF}
@@ -12070,6 +12069,31 @@ echo "$tmp"])])
 @end example
 @end defmac
 
address@hidden AS_VAR_APPEND (@var{var}, @var{text})
address@hidden
+Emit shell code to append the shell expansion of @var{text} to the end
+of the current contents of the polymorphic shell variable @var{var},
+taking advantage of shells that provide the @samp{+=} extension for more
+efficient scaling.
+
+For situations where the final contents of @var{var} are relatively
+short (less than 256 bytes), it is more efficient to use the simpler
+code sequence of @address@hidden@address@hidden@address@hidden (or its
+polymorphic equivalent of @code{AS_VAR_COPY([tmp], address@hidden)} and
address@hidden(address@hidden, ["$tmp"@var{text}])}).  But in the case
+when the script will be repeatedly appending text into @code{var},
+issues of scaling start to become apparent.  A naive implementation
+requires execution time linear to the length of the current contents of
address@hidden as well as the length of @var{text} for a single append, for
+an overall quadratic scaling with multiple appends.  This macro takes
+advantage of shells which provide the extension
address@hidden@address@hidden, which can provide amortized constant time
+for a single append, for an overall linear scaling with multiple
+appends.  Note that unlike @code{AS_VAR_SET}, this macro requires that
address@hidden be quoted properly to avoid field splitting and file name
+expansion.
address@hidden defmac
+
 @defmac AS_VAR_COPY (@var{dest}, @var{source})
 @asindex{VAR_COPY}
 Emit shell code to assign the contents of the polymorphic shell variable
@@ -12122,7 +12146,8 @@ composed variable name based on @var{value}, it is 
easier to declare a
 temporary m4 macro @var{m4-name} with @code{AS_VAR_PUSHDEF}, then use
 that macro as the argument to subsequent @code{AS_VAR} macros as a
 polymorphic variable name, and finally free the temporary macro with
address@hidden
address@hidden  These macros are often followed with @code{dnl},
+to avoid excess newlines in the output.
 
 Here is an involved example, that shows the power of writing macros that
 can handle composed shell variable names:
@@ -12163,7 +12188,10 @@ header stdlib.h detected
 @defmac AS_VAR_SET (@var{var}, @ovar{value})
 @asindex{VAR_SET}
 Emit shell code to assign the contents of the polymorphic shell variable
address@hidden to the shell expansion of @var{value}.
address@hidden to the shell expansion of @var{value}.  @var{value} is not
+subject to field splitting or file name expansion, so if command
+substitution is used, it may be done with @samp{`""`} rather than using
+an intermediate variable (@pxref{Shell Substitutions}).
 @end defmac
 
 @defmac AS_VAR_SET_IF (@var{var}, @ovar{if-set}, @ovar{if-undef})
@@ -21574,25 +21602,10 @@ full signature of the package, and 
@code{AT_PACKAGE_BUGREPORT}, the
 address to which bug reports should be sent.  For sake of completeness,
 we suggest that you also define @code{AT_PACKAGE_NAME},
 @code{AT_PACKAGE_TARNAME}, and @code{AT_PACKAGE_VERSION}.
address@hidden configure}, for a description of these variables.  We
-suggest the following makefile excerpt:
-
address@hidden
-# The `:;' works around a Bash 3.2 bug when the output is not writeable.
-$(srcdir)/package.m4: $(top_srcdir)/configure.ac
-        :;@{ \
-          echo '# Signature of the current package.' && \
-          echo 'm4_define([AT_PACKAGE_NAME],      [@@PACKAGE_NAME@@])' && \
-          echo 'm4_define([AT_PACKAGE_TARNAME],   [@@PACKAGE_TARNAME@@])' && \
-          echo 'm4_define([AT_PACKAGE_VERSION],   [@@PACKAGE_VERSION@@])' && \
-          echo 'm4_define([AT_PACKAGE_STRING],    [@@PACKAGE_STRING@@])' && \
-          echo 'm4_define([AT_PACKAGE_BUGREPORT], [@@PACKAGE_BUGREPORT@@])'; \
-        @} >'$(srcdir)/package.m4'
address@hidden smallexample
-
address@hidden
address@hidden configure}, for a description of these variables.
 Be sure to distribute @file{package.m4} and to put it into the source
-hierarchy: the test suite ought to be shipped!
+hierarchy: the test suite ought to be shipped!  See below for an example
address@hidden excerpt.
 
 @item
 Invoke @code{AC_CONFIG_TESTDIR}.
@@ -21611,16 +21624,33 @@ Still within @file{configure.ac}, as appropriate, 
ensure that some
 @file{tests/atlocal}.
 
 @item
-The @file{tests/Makefile.in} should be modified so the validation in
+The appropriate @file{Makefile} should be modified so the validation in
 your package is triggered by @samp{make check}.  An example is provided
 below.
 @end itemize
 
-With Automake, here is a minimal example about how to link @samp{make
-check} with a validation suite.
+With Automake, here is a minimal example for inclusion in
address@hidden/Makefile.am}, in order to link @samp{make check} with a
+validation suite.
 
 @example
-EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in
+# The `:;' works around a Bash 3.2 bug when the output is not writeable.
+$(srcdir)/package.m4: $(top_srcdir)/configure.ac
+        :;@{ \
+          echo '# Signature of the current package.' && \
+          echo 'm4_define([AT_PACKAGE_NAME],' && \
+          echo '  [@@PACKAGE_NAME@@])' && \
+          echo 'm4_define([AT_PACKAGE_TARNAME],' && \
+          echo '  [@@PACKAGE_TARNAME@@])' && \
+          echo 'm4_define([AT_PACKAGE_VERSION],' && \
+          echo '  [@@PACKAGE_VERSION@@])' && \
+          echo 'm4_define([AT_PACKAGE_STRING],' && \
+          echo '  [@@PACKAGE_STRING@@])' && \
+          echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
+          echo '  [@@PACKAGE_BUGREPORT@@])'; \
+        @} >'$(srcdir)/package.m4'
+
+EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) atlocal.in
 TESTSUITE = $(srcdir)/testsuite
 
 check-local: atconfig atlocal $(TESTSUITE)
@@ -21634,17 +21664,25 @@ clean-local:
         test ! -f '$(TESTSUITE)' || \
          $(SHELL) '$(TESTSUITE)' --clean
 
+AUTOM4TE = $(SHELL) $(srcdir)/build-aux/missing --run autom4te
 AUTOTEST = $(AUTOM4TE) --language=autotest
 $(TESTSUITE): $(srcdir)/testsuite.at
         $(AUTOTEST) -I '$(srcdir)' -o $@@.tmp $@@.at
         mv $@@.tmp $@@
 @end example
 
+Note that the built testsuite is distributed; this is necessary because
+users might not have Autoconf installed, and thus would not be able to
+rebuild it.  Likewise, the use of @file{missing} provides the user with
+a nicer error message if they modify a source file to the testsuite, and
+accidentally trigger the rebuild rules.
+
 You might want to list explicitly the dependencies, i.e., the list of
 the files @file{testsuite.at} includes.
 
-If you don't use Automake, you might need to add lines inspired from the
-following:
+If you don't use Automake, you should include the above example in
address@hidden/@/Makefile.in}, along with additional lines inspired from
+the following:
 
 @example
 subdir = tests
@@ -21659,10 +21697,9 @@ atlocal: $(srcdir)/atlocal.in 
$(top_builddir)/config.status
 @end example
 
 @noindent
-and manage to have @code{$(EXTRA_DIST)} distributed.
-
-If you use Automake, however, you don't need to add a rule to generate
address@hidden
+and manage to have @code{$(EXTRA_DIST)} distributed.  You will also want
+to distribute the file @file{build-aux/@/missing} from the Automake
+project; a copy of this file resides in the Autoconf source.
 
 With all this in place, and if you have not initialized @samp{TESTSUITEFLAGS}
 within your makefile, you can fine-tune test suite execution with this
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 6e250ee..f3b3e5f 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -477,7 +477,8 @@ break])
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 rm -f conftest.err conftest.$ac_ext
-AS_IF([$ac_preproc_ok], [$1], [$2])])# _AC_PROG_PREPROC_WORKS_IFELSE
+AS_IF([$ac_preproc_ok], [$1], [$2])
+])# _AC_PROG_PREPROC_WORKS_IFELSE
 
 
 # AC_PROG_CPP
@@ -1336,7 +1337,7 @@ AC_DEFUN([AC_PROG_CC_STDC],
     [no], [ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no],
          [_AC_PROG_CC_C99([ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99],
             [_AC_PROG_CC_C89([ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
-                             [ac_cv_prog_cc_stdc=no])])])dnl
+                             [ac_cv_prog_cc_stdc=no])])])
   AC_MSG_CHECKING([for $CC option to accept ISO Standard C])
   AC_CACHE_VAL([ac_cv_prog_cc_stdc], [])
   AS_CASE([$ac_cv_prog_cc_stdc],
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index c325f30..14fe315 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Checking for functions.
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# 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
@@ -70,7 +70,7 @@ AC_CACHE_CHECK([for $1], [ac_var],
 [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
                [AS_VAR_SET([ac_var], [yes])],
                [AS_VAR_SET([ac_var], [no])])])
-AS_VAR_IF([ac_var], [yes], [$2], [$3])dnl
+AS_VAR_IF([ac_var], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_var])dnl
 ])# AC_CHECK_FUNC
 
@@ -104,7 +104,7 @@ AC_DEFUN([AC_CHECK_FUNCS_ONCE],
   m4_foreach_w([AC_Func], [$1],
     [AC_DEFUN([_AC_Func_]m4_defn([AC_Func]),
        [m4_divert_text([INIT_PREPARE],
-         [ac_func_list="$ac_func_list AC_Func"])
+         [AS_VAR_APPEND([ac_func_list], [" AC_Func"])])
        _AC_FUNCS_EXPANSION])
      AC_REQUIRE([_AC_Func_]m4_defn([AC_Func]))])
 ])
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index b5c720d..95734ec 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1226,9 +1226,9 @@ do
       ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) AS_VAR_APPEND([ac_configure_args0], [" '$ac_arg'"]) ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      AS_VAR_APPEND([ac_configure_args1], [" '$ac_arg'"])
 dnl If trying to remove duplicates, be sure to (i) keep the *last*
 dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only),
 dnl and (ii) not to strip long options (--prefix foo --prefix bar might
@@ -1250,7 +1250,7 @@ dnl exit don't matter.
          -* ) ac_must_keep_next=true ;;
        esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"])
       ;;
     esac
   done
@@ -1433,7 +1433,7 @@ m4_define([_m4_divert(HELP_ENABLE)],    
_m4_divert(HELP_WITH))
 #
 m4_define([_AC_ENABLE_IF],
 address@hidden:@ Check whether --$1-$2 was given.
-_AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-.], [__]), [$3], [$4])[]dnl
+_AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-.], [__]), [$3], [$4])
 ])
 
 m4_define([_AC_ENABLE_IF_ACTION],
@@ -1594,7 +1594,7 @@ for ac_var in $ac_precious_vars; do
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) ;;
     esac
   fi
 done
@@ -2002,7 +2002,8 @@ m4_if(m4_index([$2], [AC_SUBST]), [-1], [],
 [where no actions should be taken])])dnl
 AS_VAR_SET_IF([$1],
              [_AS_ECHO_N([(cached) ])],
-             [$2])])
+             [$2])
+])
 
 
 # AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
@@ -2392,7 +2393,7 @@ m4_define([_AC_PREPROC_IFELSE_BODY],
   rm -f conftest.err
   AS_LINENO_POP
   return $ac_retval
-])
+])# _AC_PREPROC_IFELSE_BODY
 
 
 # _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
@@ -2405,7 +2406,7 @@ AC_DEFUN([_AC_PREPROC_IFELSE],
 [AC_REQUIRE_SHELL_FN([ac_func_]_AC_LANG_ABBREV[_try_cpp],
   [AS_FUNCTION_DESCRIBE([ac_func_]_AC_LANG_ABBREV[_try_cpp], [LINENO],
     [Try to preprocess conftest.$ac_ext, and return whether this succeeded.])],
-    [$0_BODY])]dnl
+  [$0_BODY])]dnl
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
 [AS_IF([ac_func_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3])
 m4_ifvaln([$1], [rm -f conftest.$ac_ext])dnl
@@ -2446,7 +2447,7 @@ dnl Ultrix and Pyramid sh refuse to redirect output of 
eval, so use subshell.
 dnl Quote $1 to prevent m4 from eating character classes
   $EGREP "[$1]" >/dev/null 2>&1],
   [$3],
-  [$4])dnl
+  [$4])
 rm -f conftest*
 ])# AC_EGREP_CPP
 
@@ -2466,22 +2467,37 @@ AC_DEFUN([AC_EGREP_HEADER],
 ## Examining syntax.  ##
 ## ------------------ ##
 
+# _AC_COMPILE_IFELSE_BODY
+# -----------------------
+# Shell function body for _AC_COMPILE_IFELSE.
+m4_define([_AC_COMPILE_IFELSE_BODY],
+[  AS_LINENO_PUSH([$[]1])
+  rm -f conftest.$ac_objext
+  AS_IF([_AC_DO_STDERR($ac_compile) && {
+        test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext],
+      [ac_retval=0],
+      [_AC_MSG_LOG_CONFTEST
+       ac_retval=1])
+  rm -f core conftest.err conftest.$ac_objext
+  AS_LINENO_POP
+  return $ac_retval
+])# _AC_COMPILE_IFELSE_BODY
+
 
 # _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 # ----------------------------------------------------------------
 # Try to compile PROGRAM.
 # This macro can be used during the selection of a compiler.
-m4_define([_AC_COMPILE_IFELSE],
-[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
-rm -f conftest.$ac_objext
-AS_IF([_AC_DO_STDERR($ac_compile) && {
-        test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext],
-      [$2],
-      [_AC_MSG_LOG_CONFTEST
-       $3])
-rm -f core conftest.err conftest.$ac_objext m4_ifval([$1], 
[conftest.$ac_ext])[]dnl
+AC_DEFUN([_AC_COMPILE_IFELSE],
+[AC_REQUIRE_SHELL_FN([ac_func_]_AC_LANG_ABBREV[_try_compile],
+  [AS_FUNCTION_DESCRIBE([ac_func_]_AC_LANG_ABBREV[_try_compile], [LINENO],
+    [Try to compile conftest.$ac_ext, and return whether this succeeded.])],
+  [$0_BODY])]dnl
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
+[AS_IF([ac_func_[]_AC_LANG_ABBREV[]_try_compile "$LINENO"], [$2], [$3])
+m4_ifvaln([$1], [rm -f conftest.$ac_ext])dnl
 ])# _AC_COMPILE_IFELSE
 
 
@@ -2590,7 +2606,7 @@ AS_IF([_AC_DO_VAR(ac_link) && 
_AC_DO_TOKENS(./conftest$ac_exeext)],
 _AC_MSG_LOG_CONFTEST
 m4_ifvaln([$3],
          [( exit $ac_status )
-$3])dnl])[]dnl
+$3])dnl])
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext 
conftest.$ac_objext m4_ifval([$1],
                                                     [conftest.$ac_ext])[]dnl
@@ -2645,7 +2661,7 @@ if test -r "$1"; then
 else
   AS_VAR_SET([ac_File], [no])
 fi])
-AS_VAR_IF([ac_File], [yes], [$2], [$3])[]dnl
+AS_VAR_IF([ac_File], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_File])dnl
 ])# AC_CHECK_FILE
 
@@ -2682,7 +2698,7 @@ AC_CACHE_CHECK([whether $1 is declared], [ac_Symbol],
 ])],
                   [AS_VAR_SET([ac_Symbol], [yes])],
                   [AS_VAR_SET([ac_Symbol], [no])])])
-AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])[]dnl
+AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Symbol])dnl
 ])# AC_CHECK_DECL
 
@@ -2784,8 +2800,8 @@ for ac_i in : $LIB@&address@hidden; do test "x$ac_i" = x: 
&& continue
   ac_i=`AS_ECHO(["$ac_i"]) | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+  AS_VAR_APPEND([ac_libobjs], [" \${LIBOBJDIR}$ac_i\$U.$ac_objext"])
+  AS_VAR_APPEND([ac_ltlibobjs], [" \${LIBOBJDIR}$ac_i"'$U.lo'])
 done
 AC_SUBST([LIB@&address@hidden, [$ac_libobjs])
 AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 16b2737..4012107 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -1,8 +1,8 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Checking for headers.
 #
-# Copyright (C) 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2008
+# 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
@@ -141,9 +141,9 @@ case 
$ac_header_compiler:$ac_header_preproc:$ac_[]_AC_LANG_ABBREV[]_preproc_warn
     ;;
 esac
 AC_CACHE_CHECK([for $1], [ac_Header],
-              [AS_VAR_SET([ac_Header], [$ac_header_preproc])])
-])dnl ! set ac_HEADER
-AS_VAR_IF([ac_Header], [yes], [$2], [$3])[]dnl
+              [AS_VAR_SET([ac_Header], [$ac_header_preproc])])[]dnl
+])
+AS_VAR_IF([ac_Header], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Header])dnl
 ])# _AC_CHECK_HEADER_MONGREL
 
@@ -160,7 +160,7 @@ AC_CACHE_CHECK([for $1], [ac_Header],
 @%:@include <$1>])],
                                  [AS_VAR_SET([ac_Header], [yes])],
                                  [AS_VAR_SET([ac_Header], [no])])])
-AS_VAR_IF([ac_Header], [yes], [$2], [$3])[]dnl
+AS_VAR_IF([ac_Header], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Header])dnl
 ])# _AC_CHECK_HEADER_NEW
 
@@ -175,7 +175,7 @@ AC_CACHE_CHECK([for $1], [ac_Header],
               [AC_PREPROC_IFELSE([AC_LANG_SOURCE(address@hidden:@include 
<$1>])],
                                         [AS_VAR_SET([ac_Header], [yes])],
                                         [AS_VAR_SET([ac_Header], [no])])])
-AS_VAR_IF([ac_Header], [yes], [$2], [$3])[]dnl
+AS_VAR_IF([ac_Header], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Header])dnl
 ])# _AC_CHECK_HEADER_OLD
 
@@ -212,7 +212,7 @@ AC_DEFUN([AC_CHECK_HEADERS_ONCE],
   m4_foreach_w([AC_Header], [$1],
     [AC_DEFUN([_AC_Header_]m4_quote(m4_translit(AC_Header, [./-], [___])),
        [m4_divert_text([INIT_PREPARE],
-         [ac_header_list="$ac_header_list AC_Header"])
+         [AS_VAR_APPEND([ac_header_list], [" AC_Header"])])
        _AC_HEADERS_EXPANSION])
      AC_REQUIRE([_AC_Header_]m4_quote(m4_translit(AC_Header, [./-], [___])))])
 ])
@@ -403,7 +403,7 @@ AC_CACHE_CHECK([for $1 that defines DIR], [ac_Header],
 return 0;])],
                   [AS_VAR_SET([ac_Header], [yes])],
                   [AS_VAR_SET([ac_Header], [no])])])
-AS_VAR_IF([ac_Header], [yes], [$2], [$3])[]dnl
+AS_VAR_IF([ac_Header], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Header])dnl
 ])# _AC_CHECK_HEADER_DIRENT
 
diff --git a/lib/autoconf/libs.m4 b/lib/autoconf/libs.m4
index 03258f0..cbc4218 100644
--- a/lib/autoconf/libs.m4
+++ b/lib/autoconf/libs.m4
@@ -79,16 +79,16 @@ for ac_lib in '' $2; do
     LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
   fi
   AC_LINK_IFELSE([], [AS_VAR_SET([ac_Search], [$ac_res])])
-  AS_VAR_SET_IF([ac_Search], [break])dnl
+  AS_VAR_SET_IF([ac_Search], [break])
 done
-AS_VAR_SET_IF([ac_Search], , [AS_VAR_SET([ac_Search], [no])])dnl
+AS_VAR_SET_IF([ac_Search], , [AS_VAR_SET([ac_Search], [no])])
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS])
 AS_VAR_COPY([ac_res], [ac_Search])
 AS_IF([test "$ac_res" != no],
   [test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
   $3],
-      [$4])dnl
+      [$4])
 AS_VAR_POPDEF([ac_Search])dnl
 ])
 
@@ -134,7 +134,7 @@ AS_VAR_IF([ac_Lib], [yes],
       [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
   LIBS="-l$1 $LIBS"
 ])],
-      [$4])dnl
+      [$4])
 AS_VAR_POPDEF([ac_Lib])dnl
 ])# AC_CHECK_LIB
 
diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 26fa2cf..3cbf618 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -1151,7 +1151,7 @@ if test "$no_recursion" != yes; then
       case $ac_arg in
       *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
       esac
-      ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
+      AS_VAR_APPEND([ac_sub_configure_args], [" '$ac_arg'"]) ;;
     esac
   done
 
@@ -1485,7 +1485,7 @@ m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
     case $ac_optarg in
     *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    AS_VAR_APPEND([CONFIG_FILES], [" '$ac_optarg'"])
     ac_need_defaults=false;;
 ])dnl
 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
@@ -1494,7 +1494,7 @@ m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
     case $ac_optarg in
     *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    AS_VAR_APPEND([CONFIG_HEADERS], [" '$ac_optarg'"])
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
@@ -1511,7 +1511,7 @@ Try `$[0] --help' for more information.]);;
   -*) AC_MSG_ERROR([unrecognized option: $[1]
 Try `$[0] --help' for more information.]) ;;
 
-  *) ac_config_targets="$ac_config_targets $[1]"
+  *) AS_VAR_APPEND([ac_config_targets], [" $[1]"])
      ac_need_defaults=false ;;
 
   esac
@@ -1671,7 +1671,7 @@ do
           AC_MSG_ERROR([cannot find input file: $ac_f]);;
       esac
       case $ac_f in *\'*) ac_f=`AS_ECHO(["$ac_f"]) | sed 
"s/'/'\\\\\\\\''/g"`;; esac
-      ac_file_inputs="$ac_file_inputs '$ac_f'"
+      AS_VAR_APPEND([ac_file_inputs], [" '$ac_f'"])
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4
index 0ab85a5..2c89b2f 100644
--- a/lib/autoconf/types.m4
+++ b/lib/autoconf/types.m4
@@ -160,7 +160,7 @@ AC_COMPILE_IFELSE(
          return 0;])],
      [],
      [AS_VAR_SET([ac_Type], [yes])])])])
-AS_VAR_IF([ac_Type], [yes], [$2], [$3])[]dnl
+AS_VAR_IF([ac_Type], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Type])dnl
 ])# _AC_CHECK_TYPE_NEW
 
@@ -834,7 +834,7 @@ if (sizeof ac_aggr.m4_bpatsubst([$1], [^[^.]*\.]))
 return 0;])],
                [AS_VAR_SET([ac_Member], [yes])],
                [AS_VAR_SET([ac_Member], [no])])])])
-AS_VAR_IF([ac_Member], [yes], [$2], [$3])dnl
+AS_VAR_IF([ac_Member], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Member])dnl
 ])# AC_CHECK_MEMBER
 
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 8df9395..149fff1 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -510,7 +510,7 @@ do
 
     [[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
        at_func_validate_ranges at_option
-       at_groups="$at_groups$at_option "
+       AS_VAR_APPEND([at_groups], ["$at_option "])
        ;;
 
     # Ranges
@@ -519,7 +519,7 @@ do
        at_func_validate_ranges at_range_start
        at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/^.* \('$at_range_start' \)/\1/'`
-       at_groups="$at_groups$at_range "
+       AS_VAR_APPEND([at_groups], ["$at_range "])
        ;;
 
     [-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]])
@@ -527,7 +527,7 @@ do
        at_func_validate_ranges at_range_end
        at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/\( '$at_range_end'\) .*$/\1/'`
-       at_groups="$at_groups$at_range "
+       AS_VAR_APPEND([at_groups], ["$at_range "])
        ;;
 
     [[0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9]] | \
@@ -547,7 +547,7 @@ do
        at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/^.*\( '$at_range_start' \)/\1/' \
              -e 's/\( '$at_range_end'\) .*$/\1/'`
-       at_groups="$at_groups$at_range "
+       AS_VAR_APPEND([at_groups], ["$at_range "])
        ;;
 
     # Directory selection.
@@ -603,7 +603,7 @@ do
        at_groups_selected=`AS_ECHO(["$at_groups_selected"]) | sed 's/;.*//' |
          tr "$as_nl" ' '
        `
-       at_groups="$at_groups$at_groups_selected "
+       AS_VAR_APPEND([at_groups], ["$at_groups_selected "])
        ;;
 m4_divert_pop([PARSE_ARGS])dnl
 dnl Process *=* last to allow for user specified --option=* type arguments.
@@ -619,7 +619,7 @@ m4_divert_push([PARSE_ARGS_END])dnl
        at_value=`AS_ECHO(["$at_optarg"]) | sed "s/'/'\\\\\\\\''/g"`
        # Export now, but save eval for later and for debug scripts.
        export $at_envvar
-       at_debug_args="$at_debug_args $at_envvar='$at_value'"
+       AS_VAR_APPEND([at_debug_args], [" $at_envvar='$at_value'"])
        ;;
 
      *) AS_ECHO(["$as_me: invalid option: $at_option"]) >&2
@@ -840,19 +840,19 @@ fi
 AUTOTEST_PATH=`AS_ECHO(["$AUTOTEST_PATH"]) | sed "s|:|$PATH_SEPARATOR|g"`
 at_path=
 _AS_PATH_WALK([$AUTOTEST_PATH $PATH],
-[test -n "$at_path" && at_path=$at_path$PATH_SEPARATOR
+[test -n "$at_path" && AS_VAR_APPEND([at_path], [$PATH_SEPARATOR])
 case $as_dir in
   [[\\/]]* | ?:[[\\/]]* )
-    at_path=$at_path$as_dir
+    AS_VAR_APPEND([at_path], ["$as_dir"])
     ;;
   * )
     if test -z "$at_top_build_prefix"; then
       # Stand-alone test suite.
-      at_path=$at_path$as_dir
+      AS_VAR_APPEND([at_path], ["$as_dir"])
     else
       # Embedded test suite.
-      at_path=$at_path$at_top_build_prefix$as_dir$PATH_SEPARATOR
-      at_path=$at_path$at_top_srcdir/$as_dir
+      AS_VAR_APPEND([at_path], ["$at_top_build_prefix$as_dir$PATH_SEPARATOR"])
+      AS_VAR_APPEND([at_path], ["$at_top_srcdir/$as_dir"])
     fi
     ;;
 esac])
@@ -871,7 +871,7 @@ esac
 case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
   *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
   $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
-  *) at_new_path=$at_new_path$PATH_SEPARATOR$as_dir ;;
+  *) AS_VAR_APPEND([at_new_path], ["$PATH_SEPARATOR$as_dir"]) ;;
 esac])
 PATH=$at_new_path
 export PATH
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 9ef15f5..c2c4afd 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -241,8 +241,7 @@ dnl Remove any tests from suggested that are also required
       echo shells that I found on your system.  Please install a
       echo modern shell, or manually run the script under such a
       echo shell if you do have one.
-      AS_EXIT(1)])
-    ])
+      AS_EXIT(1)])])
 fi
 ])# _AS_DETECT_BETTER_SHELL
 
@@ -280,6 +279,7 @@ _AS_TEST_PREPARE
 _AS_TR_CPP_PREPARE
 _AS_TR_SH_PREPARE
 _AS_UNSET_PREPARE
+_AS_VAR_APPEND_PREPARE
 m4_popdef([AS_REQUIRE])dnl
 ])
 
@@ -303,6 +303,7 @@ AS_REQUIRE([_AS_TEST_PREPARE])
 AS_REQUIRE([_AS_TR_CPP_PREPARE])
 AS_REQUIRE([_AS_TR_SH_PREPARE])
 AS_REQUIRE([_AS_UNSET_PREPARE])
+AS_REQUIRE([_AS_VAR_APPEND_PREPARE], [], [M4SH-INIT-FN])
 m4_divert_pop[]dnl
 ])
 
@@ -497,12 +498,9 @@ m4_define([_AS_CASE_DEFAULT],
 [  *[)] $1 ;;
 ])
 m4_defun([AS_CASE],
-[m4_ifval([$2$3],
 [case $1 in
 m4_map_args_pair([_$0], [_$0_DEFAULT], m4_shift($@))dnl
-esac
-])dnl
-])# AS_CASE
+esac])# AS_CASE
 
 
 # AS_EXIT([EXIT-CODE = 1])
@@ -519,8 +517,8 @@ m4_define([AS_EXIT],
 [{ (exit m4_default([$1], 1)); exit m4_default([$1], 1); }])
 
 
-# AS_IF(TEST1, [IF-TRUE1]...[IF-FALSE])
-# -------------------------------------
+# AS_IF(TEST1, [IF-TRUE1 = :]...[IF-FALSE = :])
+# ---------------------------------------------
 # Expand into
 # | if TEST1; then
 # |   IF-TRUE1
@@ -541,13 +539,10 @@ m4_define([_AS_IF_ELSE],
 [else
   $1])])
 m4_defun([AS_IF],
-[m4_ifval([$2$3],
 [if $1; then
   m4_default([$2], [:])
 m4_map_args_pair([_$0], [_$0_ELSE], m4_shift2($@))dnl
-fi
-])dnl
-])# AS_IF
+fi])# AS_IF
 
 
 # _AS_UNSET_PREPARE
@@ -1637,6 +1632,52 @@ AS_REQUIRE([_AS_TR_CPP_PREPARE])dnl
 # when passed through eval, and a polymorphic name is either type.
 
 
+# _AS_VAR_APPEND_PREPARE
+# ----------------------
+# Define as_func_append to the optimum definition for the current
+# shell (bash and zsh provide the += assignment operator to avoid
+# quadratic append growth over repeated appends).
+m4_defun([_AS_VAR_APPEND_PREPARE],
+[AS_FUNCTION_DESCRIBE([as_func_append], [VAR VALUE],
+[Append the text in VALUE to the end of the definition contained in
+VAR.  Take advantage of any shell optimizations that allow amortized
+linear growth over repeated appends, instead of the typical quadratic
+growth present in naive implementations.])
+AS_IF([_AS_RUN(["AS_ESCAPE([_AS_VAR_APPEND_WORKS])"])],
+[eval 'as_func_append ()
+  {
+    eval $[]1+=\$[]2
+  }'],
+[as_func_append ()
+  {
+    eval $[]1=\$$[]1\$[]2
+  }]) # as_func_append
+])
+
+
+# _AS_VAR_APPEND_WORKS
+# --------------------
+# Output a shell test to discover whether += works.
+m4_define([_AS_VAR_APPEND_WORKS],
+[as_var=1; as_var+=2; test x$as_var = x12])
+
+
+# AS_VAR_APPEND(VAR, VALUE)
+# -------------------------
+# Append the shell expansion of VALUE to the end of the existing
+# contents of the polymorphic shell variable VAR, taking advantage of
+# any shell optimizations that allow repeated appends to result in
+# amortized linear scaling rather than quadratic behavior.  This macro
+# is not worth the overhead unless the expected final size of the
+# contents of VAR outweigh the typical VALUE size of repeated appends.
+# Note that unlike AS_VAR_SET, VALUE must be properly quoted to avoid
+# field splitting and file name expansion.
+m4_define([AS_VAR_APPEND],
+[_AS_DETECT_SUGGESTED([_AS_VAR_APPEND_WORKS])dnl
+AS_REQUIRE([_AS_VAR_APPEND_PREPARE], [], [M4SH-INIT-FN])dnl
+as_func_append $1 $2])
+
+
 # AS_VAR_COPY(DEST, SOURCE)
 # -------------------------
 # Set the polymorphic shell variable DEST to the contents of the polymorphic
@@ -1724,7 +1765,8 @@ m4_pushdef([$1], [$as_[$1]])])])
 # AS_VAR_SET(VARIABLE, VALUE)
 # ---------------------------
 # Set the contents of the polymorphic shell VARIABLE to the shell
-# expansion of VALUE.
+# expansion of VALUE.  VALUE is immune to field splitting and file
+# name expansion.
 m4_define([AS_VAR_SET],
 [AS_LITERAL_IF([$1],
               [$1=$2],
@@ -1742,7 +1784,7 @@ m4_define([AS_VAR_SET_IF],
 # AS_VAR_TEST_SET(VARIABLE)
 # -------------------------
 # Expands into the `test' expression which is true if VARIABLE
-# is set.  Polymorphic.  Should be dnl'ed.
+# is set.  Polymorphic.
 m4_define([AS_VAR_TEST_SET],
 [AS_LITERAL_IF([$1],
               [test "${$1+set}" = set],
diff --git a/tests/m4sh.at b/tests/m4sh.at
index b0ddafd..49c2b7e 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -799,6 +799,15 @@ AS_CASE([foo],
         [foo], [echo ten],
         [*],   [echo wrong])
 
+# check for nesting, lists, and side effects
+empty=
+AS_IF([AS_IF([$empty], [echo eleven])]) && AS_CASE([foo]) && echo twelve
+rm -f file
+AS_IF([touch file; false]) && echo thirteen
+test -f file && echo fourteen
+rm -f file
+AS_CASE([`touch file; false`]) && test -f file && echo fifteen
+
 # check that require works correctly
 m4_for([n], 1, 9, [],
 [m4_defun([FOO]n, [foo]n[=]n)dnl
@@ -844,6 +853,11 @@ seven
 eight
 nine
 ten
+eleven
+twelve
+thirteen
+fourteen
+fifteen
 foo1=1 bar1=1
 foo2=2 bar2=
 foo3=3 bar3=
@@ -926,7 +940,7 @@ AT_CLEANUP
 ## AS_VAR_*.  ##
 ## ---------- ##
 
-AT_SETUP([AS@&address@hidden)
+AT_SETUP([AS@&address@hidden basics])
 AT_KEYWORDS([m4sh AS@&address@hidden AS@&address@hidden AS@&address@hidden)
 AT_KEYWORDS([AS@&address@hidden AS@&address@hidden AS@&address@hidden)
 AT_KEYWORDS([AS@&address@hidden AS@&address@hidden)
@@ -935,14 +949,14 @@ AT_DATA_M4SH([script.as], [[dnl
 AS_INIT
 # Literals.
 dnl AS_VAR_SET_IF also covers AS_VAR_TEST_SET
-AS_VAR_SET_IF([foo], [echo oops], [echo ok])
+AS_VAR_SET_IF([foo], [echo oops]) && echo ok
 AS_VAR_SET([foo], ['\a  "weird" `value` with; $fun '\''characters
 ']) # 'font-lock
 AS_VAR_COPY([bar], [foo])
 AS_ECHO(["$bar-"])
 AS_ECHO(["AS_VAR_GET([foo])-"])
 AS_VAR_SET_IF([foo], [echo ok], [echo oops])
-AS_VAR_IF([foo], [string], [echo oops], [echo ok])
+AS_VAR_IF([foo], [string], [echo oops]) && echo ok
 AS_VAR_PUSHDEF([tmp], [foo])
 AS_VAR_IF([tmp], ['\a  "weird" `value` with; $fun '\''characters
 '], [echo ok], [echo oops]) # 'font-lock
@@ -952,7 +966,7 @@ m4_ifdef([tmp], [echo oops])
 # Indirects via shell vars.
 echo '===='
 num=1
-AS_VAR_SET_IF([foo$num], [echo oops], [echo ok])
+AS_VAR_SET_IF([foo$num], [echo oops]) && echo ok
 AS_VAR_SET([foo$num], ['\a  "weird" `value` with; $fun '\''characters
 ']) # 'font-lock
 AS_VAR_COPY([bar], [foo$num])
@@ -961,7 +975,7 @@ AS_VAR_COPY([foo$num], [bar])
 AS_ECHO(["$foo2-"])
 AS_ECHO(["AS_VAR_GET([foo$num])-"])
 AS_VAR_SET_IF([foo$num], [echo ok], [echo oops])
-AS_VAR_IF([foo$num], [string], [echo oops], [echo ok])
+AS_VAR_IF([foo$num], [string], [echo oops]) && echo ok
 AS_VAR_PUSHDEF([tmp], [foo$num])
 AS_VAR_IF([tmp], ['\a  "weird" `value` with; $fun '\''characters
 '], [echo ok], [echo oops]) # 'font-lock
@@ -970,7 +984,7 @@ m4_ifdef([tmp], [echo oops])
 
 # Indirects via command substitution.
 echo '===='
-AS_VAR_SET_IF([`echo foo3`], [echo oops], [echo ok])
+AS_VAR_SET_IF([`echo foo3`], [echo oops]) && echo ok
 AS_VAR_SET([`echo foo3`], ['\a  "weird" `value` with; $fun '\''characters
 ']) # 'font-lock
 AS_VAR_COPY([bar], [`echo foo3`])
@@ -979,7 +993,7 @@ AS_VAR_COPY([`echo foo4`], [bar])
 AS_ECHO(["$foo4-"])
 AS_ECHO(["AS_VAR_GET([`echo foo4`])-"])
 AS_VAR_SET_IF([`echo foo4`], [echo ok], [echo oops])
-AS_VAR_IF([`echo foo4`], [string], [echo oops], [echo ok])
+AS_VAR_IF([`echo foo4`], [string], [echo oops]) && echo ok
 AS_VAR_PUSHDEF([tmp], [`echo foo4`])
 AS_VAR_IF([tmp], ['\a  "weird" `value` with; $fun '\''characters
 '], [echo ok], [echo oops]) # 'font-lock
@@ -1018,6 +1032,41 @@ ok
 AT_CLEANUP
 
 
+## --------------- ##
+## AS_VAR_APPEND.  ##
+## --------------- ##
+
+AT_SETUP([AS@&address@hidden)
+AT_KEYWORDS([m4sh AS@&address@hidden)
+
+AT_DATA_M4SH([script.as], [[dnl
+AS_INIT
+# Literals.
+AS_VAR_APPEND([foo], ["hello,  "])
+AS_VAR_APPEND([foo], [world])
+echo "$foo"
+# Indirects via shell vars.
+num=1
+AS_VAR_APPEND([foo$num], ['hello,  '])
+AS_VAR_APPEND([foo$num], [`echo "world"`])
+echo "$foo1"
+# Indirects via command substitution.
+h=hello w=',  world'
+AS_VAR_APPEND([`echo foo2`], [${h}])
+AS_VAR_APPEND([`echo foo2`], ["$w"])
+echo "$foo2"
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script], [],
+[[hello,  world
+hello,  world
+hello,  world
+]])
+
+AT_CLEANUP
+
+
 ## ----------------- ##
 ## AS_INIT cleanup.  ##
 ## ----------------- ##
diff --git a/tests/mktests.sh b/tests/mktests.sh
index 04c6d60..0b9da0f 100755
--- a/tests/mktests.sh
+++ b/tests/mktests.sh
@@ -2,8 +2,8 @@
 
 # Build some of the Autoconf test files.
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# 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
@@ -88,6 +88,7 @@ ac_exclude_list='
        /^AC_(SEARCH_LIBS|REPLACE_FUNCS)$/ {next}
        /^AC_(CACHE_CHECK|COMPUTE)_INT$/ {next}
        /^AC_ARG_VAR$/ {next}
+       /^AC_REQUIRE_SHELL_FN$/ {next}
 
        # Performed in the semantics tests.
        
/^AC_CHECK_(ALIGNOF|DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|(TARGET_)?TOOL|TYPE)S?$/
 {next}


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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