autoconf-patches
[Top][All Lists]
Advanced

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

AS_VAR_APPEND


From: Eric Blake
Subject: AS_VAR_APPEND
Date: Mon, 20 Oct 2008 07:20:41 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm planning on applying this tomorrow after some more testing, or earlier
if a review is offered.  This adds AS_VAR_APPEND, which allows linear
scaling of variable content growth on shells that permit var+=text (with a
fallback to good old quadratic var=${var}text on shells without the
extension), then replaces all instances that I could find in the source
code that were doing an append (although I may have missed some instances
hidden behind an eval).

For the record, here is the search I used, to narrow down my search for
where using this would be relevant:
git grep '\(^\|[^a-zA-Z_0-9]\)\([a-zA-Z_0-9]\+\)=.\?\$.\?\2' -- '*.m4'

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj8hagACgkQ84KuGfSFAYCcNQCg0x9C4EV82xTp3X47Yq9+rJ7e
9tUAniIy0T8ECJuvuQyhUP9N4CUNhANb
=TlcJ
-----END PGP SIGNATURE-----
>From e863c650971d8d52993ef09e8e01ab1cbdfab3e4 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 20 Oct 2008 05:50:01 -0600
Subject: [PATCH] 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.
* NEWS: Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog           |   11 +++++++++++
 NEWS                |    2 +-
 doc/autoconf.texi   |    9 +++++++++
 lib/m4sugar/m4sh.m4 |   44 ++++++++++++++++++++++++++++++++++++++++++++
 tests/m4sh.at       |   37 ++++++++++++++++++++++++++++++++++++-
 5 files changed, 101 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 25c8826..0aa669a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-10-20  Eric Blake  <address@hidden>
+
+       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.
+       * NEWS: Likewise.
+
 2008-10-18  Eric Blake  <address@hidden>
 
        Document bugs in { } handling.
diff --git a/NEWS b/NEWS
index 147639b..4ac8e8a 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,7 @@ 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
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index eed40c5..884b324 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -12070,6 +12070,15 @@ Polymorphic Variables
 @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}.  A
+naive implementation of this action scales quadratically, so when
+possible, this implementation takes advantage of any shell extensions
+such as @samp{var+=text} to provide scaling in amortized linear time.
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
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 75b8d84..01e9355 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -280,6 +280,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 +304,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])
 m4_divert_pop[]dnl
 ])
 
@@ -1631,6 +1633,48 @@ 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).
+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, instead of the typical quadratic growth present in
+naive implementations.])
+AS_IF([_AS_RUN(["AS_ESCAPE([_AS_VAR_APPEND_WORKS])"])],
+[eval "AS_ESCAPE([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 amortized linear scaling rather
+# than quadratic behavior.
+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
diff --git a/tests/m4sh.at b/tests/m4sh.at
index c39c8c1..010c24b 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -888,7 +888,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)
@@ -980,6 +980,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.  ##
 ## ----------------- ##
-- 
1.6.0.2


>From 37fe7c8b62e14bfe58b6d1636c15f5c30b21db34 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 20 Oct 2008 07:16:36 -0600
Subject: [PATCH] Use AS_VAR_APPEND.

* lib/autoconf/c.m4 (AC_PROG_GCC_TRADITIONAL, _AC_C_STD_TRY): Use
new macro.
* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS)
(_AC_LANG_PROGRAM_C_, _AC_FC_MAIN, _AC_FC_FUNC, AC_FC_SRCEXT):
Likewise.
* lib/autoconf/functions.m4 (AC_CHECK_FUNCS_ONCE): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE2)
(_AC_INIT_PREPARE, _AC_ARG_VAR_VALIDATE, _AC_LIBOBJS_NORMALIZE):
Likewise.
* lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Likewise.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT)
(_AC_COMPILER_EXEEXT): Likewise.
* lib/autoconf/libs.m4 (AC_PATH_XTRA): Likewise.
* lib/autoconf/programs.m4 (AC_PROG_SED): Likewise.
* lib/autoconf/specific.m4 (AC_SYS_LARGEFILE): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE)
(_AC_OUTPUT_HEADERS_PREPARE, _AC_OUTPUT_SUBDIRS, AC_OUTPUT)
(_AC_OUTPUT_CONFIG_STATUS, _AC_OUTPUT_MAIN_LOOP): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL, _AS_ECHO_PREPARE):
Add comments.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                 |   23 +++++++++++++
 lib/autoconf/c.m4         |    4 +-
 lib/autoconf/fortran.m4   |   16 +++++----
 lib/autoconf/functions.m4 |    6 ++--
 lib/autoconf/general.m4   |   14 ++++----
 lib/autoconf/headers.m4   |    6 ++--
 lib/autoconf/lang.m4      |    4 +-
 lib/autoconf/libs.m4      |   32 ++++++++++---------
 lib/autoconf/programs.m4  |    2 +-
 lib/autoconf/specific.m4  |    4 +-
 lib/autoconf/status.m4    |   22 ++++++------
 lib/autotest/general.m4   |   76 ++++++++++++++++++++++----------------------
 lib/m4sugar/m4sh.m4       |    2 +
 13 files changed, 120 insertions(+), 91 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0aa669a..656393f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,28 @@
 2008-10-20  Eric Blake  <address@hidden>
 
+       Use AS_VAR_APPEND.
+       * lib/autoconf/c.m4 (AC_PROG_GCC_TRADITIONAL, _AC_C_STD_TRY): Use
+       new macro.
+       * lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS)
+       (_AC_LANG_PROGRAM_C_, _AC_FC_MAIN, _AC_FC_FUNC, AC_FC_SRCEXT):
+       Likewise.
+       * lib/autoconf/functions.m4 (AC_CHECK_FUNCS_ONCE): Likewise.
+       * lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE2)
+       (_AC_INIT_PREPARE, _AC_ARG_VAR_VALIDATE, _AC_LIBOBJS_NORMALIZE):
+       Likewise.
+       * lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Likewise.
+       * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT)
+       (_AC_COMPILER_EXEEXT): Likewise.
+       * lib/autoconf/libs.m4 (AC_PATH_XTRA): Likewise.
+       * lib/autoconf/programs.m4 (AC_PROG_SED): Likewise.
+       * lib/autoconf/specific.m4 (AC_SYS_LARGEFILE): Likewise.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE)
+       (_AC_OUTPUT_HEADERS_PREPARE, _AC_OUTPUT_SUBDIRS, AC_OUTPUT)
+       (_AC_OUTPUT_CONFIG_STATUS, _AC_OUTPUT_MAIN_LOOP): Likewise.
+       * lib/autotest/general.m4 (AT_INIT): Likewise.
+       * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL, _AS_ECHO_PREPARE):
+       Add comments.
+
        Add AS_VAR_APPEND.
        * lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
        (_AS_VAR_APPEND_WORKS, AS_VAR_APPEND): New macros.
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 6e250ee..f6b38b9 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -658,7 +658,7 @@ Autoconf TCGETA],
     ac_cv_prog_gcc_traditional=yes)
   fi])
   if test $ac_cv_prog_gcc_traditional = yes; then
-    CC="$CC -traditional"
+    AS_VAR_APPEND([CC], [" -traditional"])
   fi
 fi
 ])# AC_PROG_GCC_TRADITIONAL
@@ -1149,7 +1149,7 @@ case "x$ac_cv_prog_cc_$1" in
   xno)
     AC_MSG_RESULT([unsupported]) ;;
   *)
-    CC="$CC $ac_cv_prog_cc_$1"
+    AS_VAR_APPEND([CC], ["$ac_cv_prog_cc_$1"])
     AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;;
 esac
 AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6])
diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
index 20d9e0c..635acc3 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -698,7 +698,7 @@ while test address@hidden:@] != 1; do
          case $[2] in
             "" | -*);;
             *)
-               ac_arg="$ac_arg$[2]"
+               AS_VAR_APPEND([ac_arg], [$[2]])
                shift; shift
                set X $ac_arg "address@hidden"
                ;;
@@ -707,7 +707,7 @@ while test address@hidden:@] != 1; do
         -YP,*)
           for ac_j in `AS_ECHO(["$ac_arg"]) | sed -e 's/-YP,/-L/;s/:/ -L/g'`; 
do
             _AC_LIST_MEMBER_IF($ac_j, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
-                               [ac_arg="$ac_arg $ac_j"
+                               [AS_VAR_APPEND([ac_arg], [" $ac_j"])
                                
ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_j"])
           done
           ;;
@@ -811,7 +811,7 @@ m4_define(_AC_LANG_PROGRAM_C_[]_AC_FC[]_HOOKS,
 AC_CACHE_CHECK([for dummy main to link with _AC_LANG libraries],
                ac_cv_[]_AC_LANG_ABBREV[]_dummy_main,
 [ac_[]_AC_LANG_ABBREV[]_dm_save_LIBS=$LIBS
- LIBS="$LIBS $[]_AC_LANG_PREFIX[]LIBS"
+ AS_VAR_APPEND([LIBS], [" $[]_AC_LANG_PREFIX[]LIBS"])
  ac_fortran_dm_var=[]_AC_FC[]_DUMMY_MAIN
  AC_LANG_PUSH(C)dnl
 
@@ -881,7 +881,7 @@ AC_DEFUN([_AC_FC_MAIN],
 AC_CACHE_CHECK([for alternate main to link with _AC_LANG libraries],
                ac_cv_[]_AC_LANG_ABBREV[]_main,
 [ac_[]_AC_LANG_ABBREV[]_m_save_LIBS=$LIBS
- LIBS="$LIBS $[]_AC_LANG_PREFIX[]LIBS"
+ AS_VAR_APPEND([LIBS], [" $[]_AC_LANG_PREFIX[]LIBS"])
  ac_fortran_dm_var=[]_AC_FC[]_DUMMY_MAIN
  AC_LANG_PUSH(C)dnl
  ac_cv_fortran_main="main" # default entry point name
@@ -1118,9 +1118,11 @@ case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in
   lower*) ac_val="m4_tolower([$1])" ;;
   *)      ac_val="unknown" ;;
 esac
-case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," underscore"*) 
ac_val="$ac_val"_ ;; esac
+case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," underscore"*) AS_VAR_APPEND(
+  [ac_val], [_]) ;; esac
 m4_if(m4_index([$1],[_]),-1,[],
-[case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," extra underscore"*) 
ac_val="$ac_val"_ ;; esac
+[case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in *," extra underscore"*) 
AS_VAR_APPEND(
+  [ac_val], [_]) ;; esac
 ])
 m4_default([$2],[$1])="$ac_val"
 ])# _AC_FC_FUNC
@@ -1247,7 +1249,7 @@ if test "x$ac_cv_fc_freeform" = xunknown; then
              [AC_MSG_ERROR([Fortran does not accept free-form source], 77)])
 else
   if test "x$ac_cv_fc_freeform" != xnone; then
-    FCFLAGS="$FCFLAGS $ac_cv_fc_freeform"
+    AS_VAR_APPEND([FCFLAGS], [" $ac_cv_fc_freeform"])
   fi
   $1
 fi
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index c325f30..4788139 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
@@ -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 83294c7..9d5ff2a 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -980,7 +980,7 @@ m4_define([_AC_INIT_PARSE_ENABLE2],
       *"
 "$2_$ac_useropt"
 "*) ;;
-      *) 
ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--$1-$ac_useropt_orig"
+      *) AS_VAR_APPEND([ac_unrecognized_opts], 
["$ac_unrecognized_sep--$1-$ac_useropt_orig"])
         ac_unrecognized_sep=', ';;
     esac
     eval $2_$ac_useropt=m4_if([$1], [$2], [\$ac_optarg], [no]) ;;dnl
@@ -1207,9 +1207,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
@@ -1231,7 +1231,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
@@ -1574,7 +1574,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
@@ -2750,8 +2750,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..cb9f653 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
@@ -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, [./-], [___])))])
 ])
diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4
index c48f1de..6f2aa46 100644
--- a/lib/autoconf/lang.m4
+++ b/lib/autoconf/lang.m4
@@ -473,7 +473,7 @@ for ac_file in $ac_files
 do
   case $ac_file in
     _AC_COMPILER_EXEEXT_REJECT ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+    * ) AS_VAR_APPEND([ac_rmfiles], [" $ac_file"]);;
   esac
 done
 rm -f $ac_rmfiles
@@ -595,7 +595,7 @@ AC_MSG_RESULT([$ac_cv_exeext])
 m4_define([_AC_COMPILER_EXEEXT],
 [AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+AS_VAR_APPEND([ac_clean_files], [" a.out a.out.dSYM a.exe b.out"])
 _AC_COMPILER_EXEEXT_DEFAULT
 _AC_COMPILER_EXEEXT_WORKS
 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
diff --git a/lib/autoconf/libs.m4 b/lib/autoconf/libs.m4
index 03258f0..c5a0ddd 100644
--- a/lib/autoconf/libs.m4
+++ b/lib/autoconf/libs.m4
@@ -389,25 +389,25 @@ if test "$no_x" = yes; then
   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
 else
   if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
+    AS_VAR_APPEND([X_CFLAGS], [" -I$x_includes"])
   fi
 
   # It would also be nice to do this for all -L options, not just this one.
   if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
+    AS_VAR_APPEND([X_LIBS], [" -L$x_libraries"])
     # For Solaris; some versions of Sun CC require a space after -R and
     # others require no space.  Words are not sufficient . . . .
     AC_MSG_CHECKING([whether -R must be followed by a space])
-    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_LIBS=$LIBS; AS_VAR_APPEND([LIBS], [" -R$x_libraries"])
     
ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
     ac_[]_AC_LANG_ABBREV[]_werror_flag=yes
     AC_LINK_IFELSE([AC_LANG_PROGRAM()],
       [AC_MSG_RESULT([no])
-       X_LIBS="$X_LIBS -R$x_libraries"],
+       AS_VAR_APPEND([X_LIBS], [" -R$x_libraries"])],
       [LIBS="$ac_xsave_LIBS -R $x_libraries"
        AC_LINK_IFELSE([AC_LANG_PROGRAM()],
         [AC_MSG_RESULT([yes])
-         X_LIBS="$X_LIBS -R $x_libraries"],
+         AS_VAR_APPEND([X_LIBS], [" -R $x_libraries"])],
         [AC_MSG_RESULT([neither works])])])
     
ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag
     LIBS=$ac_xsave_LIBS
@@ -418,18 +418,18 @@ else
   # (-lICE), since we may need -lsocket or whatever for X linking.
 
   if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+    AS_VAR_APPEND([X_EXTRA_LIBS], [" -lnsl_s -linet"])
   else
     # Martyn Johnson says this is needed for Ultrix, if the X
     # libraries were built with DECnet support.  And Karl Berry says
     # the Alpha needs dnet_stub (dnet does not exist).
-    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    ac_xsave_LIBS="$LIBS"; AS_VAR_APPEND([LIBS], [" $X_LIBS -lX11"])
     AC_LINK_IFELSE([AC_LANG_CALL([], [XOpenDisplay])],
                   [],
-    [AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+    [AC_CHECK_LIB(dnet, dnet_ntoa, [AS_VAR_APPEND([X_EXTRA_LIBS], [" 
-ldnet"])])
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       AC_CHECK_LIB(dnet_stub, dnet_ntoa,
-       [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+       [AS_VAR_APPEND([X_EXTRA_LIBS], [" -ldnet_stub"])])
     fi])
     LIBS="$ac_xsave_LIBS"
 
@@ -443,9 +443,11 @@ else
     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
     AC_CHECK_FUNC(gethostbyname)
     if test $ac_cv_func_gethostbyname = no; then
-      AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+      AC_CHECK_LIB(nsl, gethostbyname,
+       [AS_VAR_APPEND([X_EXTRA_LIBS], [" -lnsl"])])
       if test $ac_cv_lib_nsl_gethostbyname = no; then
-       AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd")
+       AC_CHECK_LIB(bsd, gethostbyname,
+         [AS_VAR_APPEND([X_EXTRA_LIBS], [" -lbsd"])])
       fi
     fi
 
@@ -465,19 +467,19 @@ else
     # Guillermo Gomez says -lposix is necessary on A/UX.
     AC_CHECK_FUNC(remove)
     if test $ac_cv_func_remove = no; then
-      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+      AC_CHECK_LIB(posix, remove, [AS_VAR_APPEND([X_EXTRA_LIBS], [" 
-lposix"])])
     fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     AC_CHECK_FUNC(shmat)
     if test $ac_cv_func_shmat = no; then
-      AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
+      AC_CHECK_LIB(ipc, shmat, [AS_VAR_APPEND([X_EXTRA_LIBS], [" -lipc"])])
     fi
   fi
 
   # Check for libraries that X11R6 Xt/Xaw programs need.
   ac_save_LDFLAGS=$LDFLAGS
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  test -n "$x_libraries" && AS_VAR_APPEND([LDFLAGS], [" -L$x_libraries"])
   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
   # check for ICE first), but we must link in the order -lSM -lICE or
   # we get undefined symbols.  So assume we have SM if we have ICE.
@@ -485,7 +487,7 @@ else
   # libraries we check for below, so use a different variable.
   # John Interrante, Karl Berry
   AC_CHECK_LIB(ICE, IceConnectionNumber,
-    [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], , $X_EXTRA_LIBS)
+    [AS_VAR_APPEND([X_PRE_LIBS], [" -lSM -lICE"])], , $X_EXTRA_LIBS)
   LDFLAGS=$ac_save_LDFLAGS
 
 fi
diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index 45a74b5..fa2bdc0 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -891,7 +891,7 @@ AC_DEFUN([AC_PROG_SED],
      dnl but more than about 7000 bytes, to catch a limit in Solaris 8 
/usr/ucb/sed.
      
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
      for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
+       AS_VAR_APPEND([ac_script], ["$as_nl$ac_script"])
      done
      echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
      AS_UNSET([ac_script])
diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4
index 5fcfe37..0328deb 100644
--- a/lib/autoconf/specific.m4
+++ b/lib/autoconf/specific.m4
@@ -170,7 +170,7 @@ if test "$enable_largefile" != no; then
         # so use the C compiler's -n32 option if that helps.
         AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
         AC_COMPILE_IFELSE([], [break])
-        CC="$CC -n32"
+        AS_VAR_APPEND([CC], [" -n32"])
         AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
         break
        done
@@ -178,7 +178,7 @@ if test "$enable_largefile" != no; then
        rm -f conftest.$ac_ext
     fi])
   if test "$ac_cv_sys_largefile_CC" != no; then
-    CC=$CC$ac_cv_sys_largefile_CC
+    AS_VAR_APPEND([CC], [$ac_cv_sys_largefile_CC])
   fi
 
   _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 26fa2cf..436639b 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -425,7 +425,7 @@ dnl Do not use grep on conf$$subs.awk, since AIX grep has a 
line length limit.
   elif $ac_last_try; then
     AC_MSG_ERROR([could not make $CONFIG_STATUS])
   else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+    AS_VAR_APPEND([ac_delim], ["!$ac_delim _$ac_delim!! "])
   fi
 done
 rm -f conf$$subs.sh
@@ -749,7 +749,7 @@ for ac_last_try in false false :; do
   elif $ac_last_try; then
     AC_MSG_ERROR([could not make $CONFIG_HEADERS])
   else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+    AS_VAR_APPEND([ac_delim], ["!$ac_delim _$ac_delim!! "])
   fi
 done
 
@@ -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
 
@@ -1271,7 +1271,7 @@ AC_OUTPUT_COMMANDS_PRE()dnl
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+AS_VAR_APPEND([ac_clean_files], [" $CONFIG_STATUS"])
 _AC_OUTPUT_CONFIG_STATUS()dnl
 ac_clean_files=$ac_clean_files_save
 
@@ -1293,7 +1293,7 @@ if test "$no_create" != yes; then
   ac_cs_success=:
   ac_config_status_args=
   test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
+    AS_VAR_APPEND([ac_config_status_args], [" --quiet"])
   exec AS_MESSAGE_LOG_FD>/dev/null
   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
   exec AS_MESSAGE_LOG_FD>>config.log
@@ -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
@@ -1522,7 +1522,7 @@ ac_configure_extra_args=
 
 if $ac_cs_silent; then
   exec AS_MESSAGE_FD>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
+  AS_VAR_APPEND([ac_configure_extra_args], [" --silent"])
 fi
 
 _ACEOF
@@ -1642,7 +1642,7 @@ do
   :[[FHL]]*:*);;
   :L* | :C*:*) AC_MSG_ERROR([invalid tag $ac_tag]);;
   :[[FH]]-) ac_tag=-:-;;
-  :[[FH]]*) ac_tag=$ac_tag:$ac_tag.in;;
+  :[[FH]]*) AS_VAR_APPEND([ac_tag], [:$ac_tag.in]);;
   esac
   ac_save_IFS=$IFS
   IFS=:
@@ -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/autotest/general.m4 b/lib/autotest/general.m4
index 9e7df68..3edfe9c 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -511,7 +511,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
@@ -520,7 +520,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]])
@@ -528,7 +528,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]] | \
@@ -548,7 +548,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.
@@ -604,7 +604,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.
@@ -620,7 +620,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
@@ -843,19 +843,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])
@@ -874,7 +874,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
@@ -1143,7 +1143,7 @@ _ATEOF
       # is written in the global log separately.  But we also
       # write to the group log in case they're using -d.
       if test -f "$at_times_file"; then
-       at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
+       AS_VAR_APPEND([at_log_msg], ["     ("`sed 1d "$at_times_file"`')'])
        rm -f "$at_times_file"
       fi
       AS_ECHO(["$at_log_msg"]) >> "$at_group_log"
@@ -1322,47 +1322,47 @@ else
 fi
 if $at_errexit_p && test $at_unexpected_count != 0; then
   if test $at_xpass_count = 1; then
-    at_result="$at_result $at_were run, one passed"
+    AS_VAR_APPEND([at_result], [" $at_were run, one passed"])
   else
-    at_result="$at_result $at_were run, one failed"
+    AS_VAR_APPEND([at_result], [" $at_were run, one failed"])
   fi
-  at_result="$at_result unexpectedly and inhibited subsequent tests."
+  AS_VAR_APPEND([at_result], [" unexpectedly and inhibited subsequent tests."])
 else
   # Don't you just love exponential explosion of the number of cases?
   case $at_xpass_count:$at_fail_count:$at_xfail_count in
     # So far, so good.
-    0:0:0) at_result="$at_result $at_were successful." ;;
-    0:0:*) at_result="$at_result behaved as expected." ;;
+    0:0:0) AS_VAR_APPEND([at_result], [" $at_were successful."]) ;;
+    0:0:*) AS_VAR_APPEND([at_result], [" behaved as expected."]) ;;
 
     # Some unexpected failures
-    0:*:0) at_result="$at_result $at_were run,
-$at_fail_count failed unexpectedly." ;;
+    0:*:0) AS_VAR_APPEND([at_result], [" $at_were run,
+$at_fail_count failed unexpectedly."]) ;;
 
     # Some failures, both expected and unexpected
-    0:*:1) at_result="$at_result $at_were run,
-$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
-    0:*:*) at_result="$at_result $at_were run,
-$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
+    0:*:1) AS_VAR_APPEND([at_result], [" $at_were run,
+$at_total_fail_count failed ($at_xfail_count expected failure)."]) ;;
+    0:*:*) AS_VAR_APPEND([at_result], [" $at_were run,
+$at_total_fail_count failed ($at_xfail_count expected failures)."]) ;;
 
     # No unexpected failures, but some xpasses
-    *:0:*) at_result="$at_result $at_were run,
-$at_xpass_count passed unexpectedly." ;;
+    *:0:*) AS_VAR_APPEND([at_result], [" $at_were run,
+$at_xpass_count passed unexpectedly."]) ;;
 
     # No expected failures, but failures and xpasses
-    *:1:0) at_result="$at_result $at_were run,
+    *:1:0) AS_VAR_APPEND([at_result], [" $at_were run,
 $at_unexpected_count did not behave as expected dnl
-($at_fail_count unexpected failure)." ;;
-    *:*:0) at_result="$at_result $at_were run,
+($at_fail_count unexpected failure)."]) ;;
+    *:*:0) AS_VAR_APPEND([at_result], [" $at_were run,
 $at_unexpected_count did not behave as expected dnl
-($at_fail_count unexpected failures)." ;;
+($at_fail_count unexpected failures)."]) ;;
 
     # All of them.
-    *:*:1) at_result="$at_result $at_were run,
+    *:*:1) AS_VAR_APPEND([at_result], [" $at_were run,
 $at_xpass_count passed unexpectedly,
-$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
-    *:*:*) at_result="$at_result $at_were run,
+$at_total_fail_count failed ($at_xfail_count expected failure)."]) ;;
+    *:*:*) AS_VAR_APPEND([at_result], [" $at_were run,
 $at_xpass_count passed unexpectedly,
-$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
+$at_total_fail_count failed ($at_xfail_count expected failures)."]) ;;
   esac
 
   if test $at_skip_count = 0 && test $at_run_count -gt 1; then
@@ -1373,10 +1373,10 @@ fi
 # Now put skips in the mix.
 case $at_skip_count in
   0) ;;
-  1) at_result="$at_result
-1 test was skipped." ;;
-  *) at_result="$at_result
-$at_skip_count tests were skipped." ;;
+  1) AS_VAR_APPEND([at_result], ["
+1 test was skipped."]) ;;
+  *) AS_VAR_APPEND([at_result], ["
+$at_skip_count tests were skipped."]) ;;
 esac
 
 if test $at_unexpected_count = 0; then
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 01e9355..4ebb8cf 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -212,6 +212,7 @@ dnl Remove any tests from suggested that are also required
       [case $as_dir in
         /*)
           for as_base in sh bash ksh sh5; do
+dnl Do not use AS_VAR_APPEND here.
             as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
           done;;
        esac])
@@ -869,6 +870,7 @@ m4_defun([_AS_ECHO_PREPARE],
 export as_nl
 # Printing a long string crashes Solaris 7 /usr/bin/printf.
 
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+dnl Do not use AS_VAR_APPEND here.
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
 if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-- 
1.6.0.2


reply via email to

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